Section 62. Any mortgagee who requires the prepayment of taxes for real estate located in the commonwealth shall pay to the city or town wherein the property is located the full amount of taxes due on or before the date upon which said taxes become due provided that the mortgagor has paid said amount to the mortgagee. If the mortgagor has not paid the full amount of taxes due before said date, the mortgagee shall pay to the city or town wherein the property is located all amounts which have been paid to him by the mortgagor.