The mayor and city council of a city of the second class or village board of trustees may, by resolution, direct and authorize the city treasurer or village treasurer to dispose of the surplus electric light, water, or gas funds, or the funds arising from the sale of electric light, water, or natural gas distribution properties, by the payment of outstanding electric light, water, or gas distribution bonds or water warrants then due. The excess, if any, after such payments may be transferred to the general fund of such city or village.