(b) The funds on deposit which are the subject of such an action may remain with such savings bank to the credit of the action until final judgment therein, and be entitled to the same interest as other deposits of the same class, or, in the case of deposits held pursuant to subdivision one-a of section two hundred thirty-four of this chapter, to interest at the rate specified in the deposit contract until maturity and at the rate at which interest is credited on regular savings accounts from maturity until final judgment, and shall be paid by such savings bank in accordance with the final judgment of the courts; or the deposit in controversy may be paid into court to await the final determination of the action, and when the deposit is so paid into court such savings bank shall be struck out as a party to the action, and its liability for such deposit shall cease.
(c) The costs in all actions against a savings bank to recover deposits shall be in the discretion of the court, and may be charged upon the fund affected by the action.