Section 86. If a company voluntarily discontinues the use of any part of its tracks for a period of six months, it shall become obligated to remove such track at such time or times as the municipal or state authorities having control of the public way or ways occupied thereby shall propose to resurface any part or parts of such way or ways or to remove the same forthwith upon order of the board of aldermen or selectmen. Upon receiving written notice from such municipal or state authorities at any time after such discontinuance for a period of six months that it is proposed to resurface any part or parts of any such way or ways, the company shall thereupon remove at its own expense such discontinued tracks coincidentally with the resurfacing of the part or parts of such way or ways which are being resurfaced or upon receipt of written notice of such order by the board of aldermen or selectmen, shall likewise remove the same forthwith, but it shall be under no obligation to pay any part of the expense of resurfacing. If the company shall fail to remove its tracks as above provided, such municipal or state authorities may cause the work to be done at the expense of the company, and such expense may be recovered in tort. If a company without right or lawful excuse discontinues the use of any track and when requested by the board of aldermen of the city or by the selectmen of the town where such track is located refuses to operate the same, the mayor of such city, if duly authorized by vote of the city council or the selectmen of such town if duly authorized by vote of the town, may petition the supreme judicial court to compel said company to resume the use of such track and to perform all its corporate duties relating thereto. Such petition shall set forth the facts upon which the petitioner relies and the relief sought, but shall not be defeated for informality, and may be amended at any stage; and said court shall have jurisdiction in equity to determine the cause and enforce its decrees and orders relative thereto. Upon the filing of any such petition said court shall order due notice to be served upon the company and shall advance the cause to a speedy hearing and final decision. In case the track, the use of which has been discontinued, is located in two or more cities or towns, any or all of such cities or towns, acting by the officials above named and authorized as hereinbefore provided, may join in such petition. This section shall not be deemed a legislative construction of any existing law or an impairment of any existing right of a company to discontinue the use of tracks.