Section 21A. In any city or town which accepts the provisions of this section, any person who is appointed to the position of chief of police or head of the municipal police department in a city, town, or district, shall not be removed from such position until a hearing is held by the appointing authority. For the purpose of this section only failure of reappointment shall be deemed to be a removal. The provisions of this section shall apply only to persons appointed to such positions under the provisions of section twenty-one.