Section 245. A person or corporation may construct a railroad for private use in the transportation of freight; but shall not take or use lands or other property therefor without the consent of the owner thereof. No such railroad shall be connected with the railroad of another corporation without its consent; nor shall it be constructed across or upon a public way or traveled place without the consent of the board of aldermen or selectmen, or the department of highways in the case of a state highway, nor except in a place and manner approved by them. If the board of aldermen or selectmen, or the department of highways in the case of a state highway, consent, they shall from time to time make such regulations relative to motive power, rate of speed, and time and manner of using the railroad over and upon such way or traveled place, as in their judgment the public safety and convenience require, and they may order such changes to be made in the track as are rendered necessary by the alteration or repair of such way. The provisions of this chapter and chapter one hundred and fifty-nine relative to the crossing of ways and traveled places by railroad corporations shall apply to such railroad, and to the person constructing or operating the same.