The mayor and council shall prescribe by ordinance the manner in which persons sentenced to imprisonment by the mayor’s court or by the recorder’s court, if such court is by ordinance and under the authority of this charter created, may be required to work in the streets and other public improvements of the town.