Section 96. If a company, its agents or servants, wilfully or negligently obstructs a public way or bridge, or hinders the passing of vehicles over the same, or wilfully detains the cars of another company having the lawful right to pass thereon, such company shall be punished by a fine of not more than five hundred dollars; and any such agent or servant shall be punished by a fine of not more than ten dollars or by imprisonment for not more than three months.