Section 22. If a town neglects to repair any way which it is obliged to keep in repair, or neglects to make the same reasonably safe and convenient when encumbered with snow, it shall pay such fine as the court may impose.