§ 241. Proceedings in court. Whenever two or more adjoining towns which, under the provisions of this chapter shall be liable to make or maintain any bridge whether in the same or different counties, three freeholders in either of such towns may, by petition signed by them, apply to the town board in each of such towns, to build, rebuild or repair such bridge, and if such town boards refuse to build, rebuild or repair such bridge within a reasonable time, either for want of funds or any other cause, such freeholders, upon affidavit and notice of motion, a copy of which shall be served on the supervisor or town clerk of each of said towns at least eight days before the hearing, may apply to the supreme court at a special term thereof, to be held in the judicial district in which such bridge or any part thereof shall be located, for an order requiring such town boards to direct the town superintendents to build, rebuild or repair such bridge, and the court upon such motion may, in doubtful cases, refer the case to some disinterested person to ascertain the requisite facts in relation thereto, and to report the evidence thereof to the court. Upon the coming in of the report, in case of such reference, or upon or after the hearing of the motion, in case no reference shall be ordered, the court shall make an order thereon as the justice of the case shall require. If the motion be granted in whole or in part, whereby funds shall be needed to carry the order into effect, such court shall specify the amount of money required for that purpose, and how much thereof shall be raised in each town.