Whenever a penalty or forfeiture or any part thereof is given to a town, the selectmen may sue therefor in the name of the town, shall defray the expenses of the action and may remit the penalty or forfeiture.