Section 39. A company, which, by its charter or certificate of incorporation, or by special act, is authorized to construct, maintain and operate a street railway in any city or town in the commonwealth, and which has constructed its railway therein, may, subject to the provisions of the general laws relative to the location, construction and operation of street railways, extend its railway into such other cities and towns in the commonwealth as the department shall, on application of such company, and after public notice and a hearing, certify that the public necessity and convenience require. An attested copy of such certificate shall, within three days after it is granted, be filed by the department in the office of the state secretary.