Section 152. Upon an application to the department, according to section twenty-four of chapter one hundred and fifty-nine, stating that a crossing of a railroad with a public way at the same level is improperly used by a railroad corporation with its freight engines, freight cars or freight trains to the unreasonable inconvenience or danger of the public, the department, after notice, shall hear the parties; and, if public convenience or safety so requires, it may direct that after a date to be fixed by it such railroad corporation shall not use such crossing or any part thereof for making up, connecting or disconnecting freight trains, or the engines or cars of such trains, or for the purpose of distributing freight or freight cars; and to prevent the same may prescribe such changes to be made in the construction of side tracks, branches and connections, in proximity to such crossings, and such regulations limiting the use of such crossings, as may be necessary. The department may at any time modify its order after a hearing and for cause shown.