Section 9. Whoever affixes to a tree in a public way or place a notice, sign, advertisement or other thing, whether in writing or otherwise, or cuts, paints or marks such tree, except for the purpose of protecting it or the public and under a written permit from the officer having the charge of such trees in a city or from the tree warden in a town, or from the department in the case of a state highway, shall be punished by a fine of not more than fifty dollars. Tree wardens shall enforce the provisions of this section; but if a tree warden fails to act in the case of a state highway within thirty days after the receipt by him of a complaint in writing from the department, the department may proceed to enforce this section.