When the selectmen of any town, the mayor and common council of any city or the warden and burgesses of any borough bring their petition in writing to the Commissioner of Transportation, representing that the public interest requires that the blowing of the engine whistle at certain points within the limits of such town, city or borough shall be dispensed with, the commissioner shall appoint a time and place for hearing such petition and shall give reasonable notice thereof to the petitioners and the company operating such railroad. If, after such hearing, the commissioner is of the opinion that the sounding of the whistle can be safely dispensed with, he shall direct such company to omit such signal and require any other signal in lieu thereof which he judges best. The commissioner may, at any time, modify or annul any such order.