Section 42. If a private corporation has erected or laid poles, wires, pipes, rails or other structures in a public way, for the construction, operation or maintenance of which damages may be recovered from such corporation under this chapter by the owners of any interest in land abutting upon such way, and such corporation does not pay such damages to an owner of any such interest after they have been finally determined and within thirty days after demand, the mayor of the city or the selectmen of the town in which such structures are located may, upon request of such owner, remove all the structures of such corporation from that portion of the public way upon which the land in which such person has an interest abuts, first leaving a written statement at the office of such corporation in such city or town of the time when and place from which they intend to remove such structures, not less than forty-eight hours prior to such removal. If such corporation has no office in such town, such notice shall be deposited in the post office, postage prepaid, and directed to such corporation at its principal office in the commonwealth. The town so removing any such structures may recover the expense thereof of such corporation. This section shall not prevent such owner from collecting the damages assessed.