1. Notwithstanding any contrary or inconsistent provisions contained in any general or special act, whenever a municipality, in the exercise of the powers conferred on it by its charter or by a general act, does any one of the following acts, to wit:(1) Grants to any person, firm, corporation or syndicate the privilege, right or franchise, for more than ten years, of constructing and maintaining, in the roads or streets of the municipality, a tramway line, and of operating the same by running cars mechanically propelled, either by electricity, steam or other motive power, for the transportation of passengers or freight, or of both; or the right, privilege or franchise, for more than ten years, of running such cars on rails already laid for such purposes in the roads or streets of the municipality; or
(2) Grants to any person, firm, corporation or syndicate the privilege, right or franchise, for more than ten years, of constructing, maintaining and operating, in the municipality, a lighting or heating system by gas or electricity or by gas and electricity, or an electric power distribution system, separate from or forming part of the lighting system and, accordingly, of erecting, laying and maintaining, in the roads, streets or public squares, electric power transmission lines or gas mains, or of supplying the public in the municipality with gas or electricity or both, for light, heat, motive power or traction purposes;The by-law or resolution granting such privilege, right or franchise shall, before having force and effect, be approved by the majority in number of the municipal electors who vote on such by-law or resolution.