If the attaching creditor denies the validity of the mortgage, pledge, lien or contract of conditional sale, and moves that its validity be tried by jury, the court shall order such trial upon an issue which shall be framed under its direction. If, upon such examination or verdict, the mortgage, pledge, lien or contract of conditional sale is adjudged valid, the mortgagee, pledgee, lienor or conditional vendor, or his assigns, shall recover his costs.
Mass. Gen. Laws ch. 223, § 81