Section 54. Except as provided in this chapter or chapter one hundred and fifty-nine or one hundred and sixty, and except for the purpose of reaching its car barns or repair shops, and of reaching and providing convenient terminals in parks and pleasure resorts situated upon the line of its railway, and of reaching its freight yards and terminals, and of maintaining spurs and sidings, and for other purposes incident to performing the business authorized by the preceding section, a company shall not, unless authorized by special act of the general court, construct or operate any part of its railway outside the limits of a public way or bridge; but such a company which, prior to June fourteenth, nineteen hundred and one, without special legislative authority therefor constructed any part of its railway upon private land, with the consent of the owners thereof, or upon land leased or purchased by such company, or which prior to said date purchased or leased land for the purpose of constructing its railway thereon, or which prior to said date after public notice and a hearing obtained the approval of the board of aldermen of a city or of the selectmen of a town to the construction of a part of its railway upon private land within such city or town, and prior to said date actually with the consent of the owners of the land began, or obtained their consent to begin, such construction, may construct, maintain and operate its railway upon such private land, subject to the provisions of this chapter conferring upon the department control over street railways constructed upon private land.