Section 12. The supreme judicial court, upon petition of a party interested and after notice, may order the sale or transfer of any real or personal property held for churches, cemeteries or other like trusts and the investment or disposition of the proceeds, and may make orders and decrees necessary to secure the rights of owners of, or of other persons claiming an interest in, pews or in tombs or lots in cemeteries.