Section 12. Witness fees and expenses of service of process may be taxed as costs against the unsuccessful party to the appeal, in the discretion of the board. In the event that the commonwealth, or any official thereof, is the unsuccessful party to an appeal, the costs shall be paid from the state treasury upon certificate of a member of the board in such form as the board may prescribe by regulation. In the event that a subdivision of the commonwealth, or any official thereof, is the unsuccessful party to an appeal, the costs shall be paid from the treasury of such subdivision by the treasurer thereof upon the certificate of a member of the board in such form as the board may prescribe by regulation. In the event that costs are taxed against an unsuccessful taxpayer, a member of the board shall certify the amount of the same and the costs may be recovered in an action of contract by the state treasurer in the case of a tax assessed by the commissioner, or by the treasurer of the subdivision of the commonwealth in the case of a tax assessed by the subdivision.