Section 52. The supreme judicial court or any justice thereof sitting in equity may, on petition of a credit union or the board of the credit union, approved by the commissioner, approve or order a reduction of the account of each shareholder or depositor therein whenever the value of its assets is less than the total amount of its shares and deposits so as to divide the loss equitably among such shareholders and depositors. If thereafter the credit union shall realize from such assets a greater sum than was fixed by such order of reduction, such excess shall be divided among the shareholders and depositors whose accounts have been reduced but only to the extent of such reduction; provided, however, that at any time after the entry of a decree approving or ordering such a reduction of accounts, such court or any justice thereof may, by order, finally determine the amount which such shareholders and depositors are equitably entitled to receive in full settlement of their accounts and the manner of distribution of such amount.