Any such railroad company shall have the right to demand from any principal contractor or construction company an indemnity or refunding bond to protect it in case of the enforcement of the liens created by § 65-10-201; and in case any original contractor or construction company is paid for work done or material furnished, or any part of it, covered by this part, and such original contractor or construction company should fail to pay any subcontractor, laborer, or materialman, for work done or material furnished, as specified in § 65-10-201, then, upon the payment of such subcontractor, laborer, or materialman of the amount due, such railroad company shall have judgment, by motion, for such amount so paid on such bond in court; but any contractor or construction company shall have the right to intervene and contest the claim of such subcontractor, laborer, or materialman claiming to be employed by such contractor or construction company.