The governments’ revenues aren’t keeping up with rising expenses, including for employee pensions, despite the thriving technology industry, home-price gains and rapid economic growth in much of the state.