The Commissioner of Transportation, when requested in writing by the selectmen of any town, the mayor of any city or the warden of any borough to forbid the use for switching purposes of the tracks of any company where the same cross any highway within such town, city or borough, shall visit such crossing, first giving reasonable notice to the authorities making such request and to such company, and, if he finds that public convenience requires, shall order the company operating such railroad not to use the same, or such part thereof as may be specified in such order, for switching purposes, and may make any order regulating such switching that he deems advisable; and, upon like application and notice, shall make such orders in regard to the laying of side tracks or tracks for switching purposes upon or across such highways, or for the removal of such tracks already laid, as he deems advisable. The commissioner may change any such order, after giving such town, city or borough and such company an opportunity to be heard.