Section 52. If land is charged with the payment of money, either in fixed amounts or in annuities for a life or lives or for years, the supreme judicial or probate court for the county where any part of such land is situated may upon the petition of the persons holding title thereto subject to the charge of such payment, and after notice and a hearing, authorize them to sell and convey by private sale or public auction the whole or any portion of such land in fee simple and free from such charges, whether present or future, certain or contingent; and it shall in such case provide by its decree for the payment of the amounts charged upon such land by placing the whole or any portion of the proceeds of the sale thereof in the hands of a trustee appointed by it, by the purchase of annuities for the persons entitled to receive the amounts so charged, or by any other means which shall be considered just and reasonable. Such trustees shall give bond in such sum as the court may order, shall, under the direction of the court, manage and account for the trust fund and shall distribute the income thereof according to its decree.