Any railroad or street railway having tracks running along a street at the time of the proposed improvements as provided herein shall be required by the mayor and council to pave the width of its track and two feet on each side with the same materials and in the same manner as the rest of the street, and such work shall be done under the supervision and subject to the approval of the city's engineer; and if such railroad or city railway shall not, within a period of 30 days after the service of written notice to do such work, agree in writing to comply with such order, or if the work is not completed to the satisfaction of the city engineer within such time as may be determined by the mayor and council, the mayor and council may proceed to have the work done and charge the cost and expense thereof to the railroad or street railway company, to be paid by it in cash, and the same until paid shall constitute a lien against all the property of the railroad or street railway company located in the city, which lien shall have the same rank and priority and be subject to the same method of enforcement as other liens. The mayor and council may in their discretion require the paving to be of a different material and manner of construction.