Section 38. A company, incorporated under the laws of the commonwealth, may, subject to this chapter and chapter one hundred and fifty-nine, construct, maintain and operate a street railway, but, if such company does not build and put in operation its railway within eighteen months after the date of its certificate of incorporation, its corporate powers shall cease, unless the department, after public notice and a hearing, shall extend said time by a certificate, stating that in its judgment due diligence has been exercised by the company, and that public necessity and convenience required such extension.