Section 142. The supreme judicial or superior court shall have jurisdiction in equity, on petition of a company, or of the board of aldermen of a city or the selectmen of a town where the street railway is located, or of any interested party, to compel the observance and to restrain the violation of all laws which govern street railway companies, and of all orders, rules and regulations made in accordance with this chapter by the board of aldermen, selectmen or the department, and to review, annul, modify or amend the rulings of any state department or commission relative to street railways as law and justice may require.