In actions of replevin brought under section thirty-six, costs shall be taxed against the plaintiff in cases where the court decides that the claim of the defendant for which he asserted a lien was no greater than the amount due under the contract. In all other cases costs shall be taxed against the defendant.
Mass. Gen. Laws ch. 255, § 39