As rising healthcare costs bear down on local governments, teachers are losing their jobs, cities and towns are cutting services, and the cash-strapped Hampshire Group Insurance Trust, which provides health insurance to thousands of municipal employees in western Massachusetts, is trying to stay afloat.