If judgment be rendered upon the right of the person so alleged to be entitled, in favor of such person, he may recover, by action, the damages which he shall have sustained by reason of the usurpation by the defendant of the office from which such defendant has been excluded.
SDCL 21-28-11