A person to whom a debt is due for labor performed or for materials furnished and actually used in constructing a railroad or railway under a contract with a person other than the railroad corporation or railway company, who has authority from or is rightfully acting for such corporation or company in furnishing such labor or materials, shall have a right of action against such corporation or company to recover such debt with costs, except as provided in the four following sections.
Mass. Gen. Laws ch. 159, § 96