Section 17. The city council of a city and the selectmen or road commissioners of a town may exercise original jurisdiction, concurrent with the county commissioners, of petitions for altering, relocating or making specific repairs upon a highway within the town limits, but except as to such parts thereof as, by such action, become unnecessary for public use, a city or town shall not discontinue any highway or diminish the width thereof, nor shall it assess upon the county any part of the expense of altering, relocating or repairing. The proceedings of cities and towns and their officers hereunder shall be the same as in the laying out of highways or town ways. Nothing in sections seventeen to nineteen, inclusive, shall diminish the powers over highways granted to a city by its charter.