In any civil action brought to try the title or right to hold any office, when the judgment of the court is in favor of the relator in the action, it is the duty of the court to issue a writ of mandamus or such other process as is necessary and proper to carry the judgment into effect, and to induct the party entitled into office.
N.C. Gen. Stat. § 1-528