If in any action under section 143 or 155 the plaintiff recovers final judgment against the Territory, the court before which the action is tried shall certify the fact of the judgment and the amount of damages and costs recovered, and the amount of the damages and costs shall be paid by the Territory to the person recovering them.