Section 39. The chief engineer or other officer in charge of a fire department, and the foreman or director of each company where no fire department is established by law, shall annually on or before May first certify to the assessors of their respective towns a list of all persons in their department or companies who during the preceding year have performed all the duties required by law. The assessors shall within ten days thereafter examine such lists and certify to the treasurers of their respective towns the amount to be paid to each person named therein. Each treasurer shall, after deducting all taxes due from the persons so named, pay the amount so certified to them, or, if minors, to their parents or guardians. Upon refusal of the treasurer to pay any sum so certified, the person entitled may recover such amount in contract.