If judgment be rendered in favor of the person so alleged to be entitled, that person may assume the office, and, by order of the court, may be put in possession thereof, and of the books and papers belonging thereto, and may recover, by action, any damages sustained by reason of such usurpation.