If, before final judgment in such pending action, the defendant therein is adjudged a trustee in the trustee process, and pays thereon the money demanded in the pending action, or any part thereof, such fact shall be stated on the record of the action, and judgment therein shall be rendered for the costs due to the plaintiff and for the part of the debt or damages remaining due and unpaid.
Mass. Gen. Laws ch. 246, § 37