The contract for the work may be made between the board of chosen freeholders and the successful bidder, in which event the railway company shall execute an agreement to pay its share from time to time to the board as the payments mature, or the contract may be made in the names of the board, the railway company and the successful bidder, whereby the board and the company shall each agree to pay directly to the contractor its share of the cost.
N.J.S. § 27:16-17