The Jailor of Hancock County shall take and receive into his custody any person sentenced to imprisonment in the Jail of said county, or committed thereto for the non-payment of fine and costs, or for the failure to enter into a recognizance, by the judgment or the order of the Mayor in proceedings for the violation of an ordinance; and the expense of maintaining such person while so in confinement shall be paid by the Town.