Section 78. All accounts of expense incurred by the railroad corporations or the city or town shall from time to time be submitted to the department of highways which shall audit the same, including any expense incurred by the commonwealth for or in connection with a state highway, and report thereon to the state comptroller. Said department shall upon request of any of the parties to the proceeding investigate the amounts presented for allowance by the commonwealth or any city or town or any railroad corporation as expended in the payment of damages for land taken or affected by reason of the proposed alteration, which have been paid by the party primarily liable therefor, as provided in section seventy-five, unless it appears that all the parties to the proceeding for the abolition of the grade crossing have assented in writing to the payment or settlement so made by the party primarily liable; and if said department determines that the amount so paid is in excess of what in its opinion should have been properly paid therefor, it shall allow only such portion of the amount so paid as it may deem to be just and reasonable. In case of any dispute as to the propriety or reasonableness of the whole or a part of any account of the expense, the department of telecommunications and energy, upon application of any party to the proceedings, shall determine the amount thereof, if any, to be allowed, and its determination shall be final. The department of highways shall, from time to time, issue its orders for payments on the part of each railroad corporation, not exceeding the amount apportioned to it by said department, and for the payment by the commonwealth of a sum not exceeding the amounts apportioned to it and to the county and city or town; and such county and city or town shall repay to the commonwealth the amount apportioned to it, with interest thereon at the rate of four per cent per annum in such instalments and at such times within ten years thereafter as said department, with the approval of the state comptroller, having regard to the financial condition of the county, city or town, shall determine.