When any controversy or cause of action shall exist between any towns of this state, or between any town and individual or corporation, proceedings may be had or suits brought, either at law or in equity, for the purpose of trying and finally settling such controversies. In all such suits and proceedings the town shall sue and be sued by its corporate name, except when town officers shall be authorized by law to sue in their names of office for the benefit of the town.