At municipal elections in all cities and towns under special charters which have not less than ten thousand inhabitants nor more than thirty thousand inhabitants there shall be elected a mayor, a police judge or recorder, an attorney, a marshal or chief of police, and such other officers as the charter and ordinances of such city or town may provide, who shall hold their respective offices for a term of two years, provided, however, any such city may provide by ordinance that marshal, chief of police and attorney may be appointed by the mayor, subject to the approval of the city council, and such ordinance may further provide that all or any of such officers when so appointed and any of the other appointive officers of any such city, except the members of the board of public works, shall hold office for an indefinite term and during the pleasure of the mayor and city council of such cities.