If judgment is for the person claiming the franchise or office, that person may recover the damages that may have been sustained by reason of the usurpation of the office by the defendant. In the action, the defendant may be provisionally arrested and held to bail in the manner as in actions where the defendant is subject to arrest.