Section 25. The aldermen of a city or the selectmen or road commissioners of a town may, if in their judgment the public convenience so requires, establish sidewalks in the public ways thereof and determine the grade of each such sidewalk and the materials with which it shall be constructed, and may order the reconstruction of existing sidewalks. No such sidewalk shall be dug up or obstructed without the consent of the board or officer having charge of the maintenance and repair of public ways in a city, or the selectmen or road commissioners in a town. Each city and town shall provide a slanted curbing on sidewalks in its public ways at pedestrian crosswalks when new or replacement curbing is required at such locations.