Section 28. The probate court may, upon petition and after notice to all persons interested, if upon a hearing it appears to be for the benefit of the estate, authorize an executor, administrator with the will annexed or administrator to mortgage any of the real estate for the purpose of paying debts, legacies or charges of administration or for the purpose of paying an existing lien or mortgage on the estate of the deceased; or it may authorize such executor or administrator to make an agreement for the extension or renewal of such existing mortgage.