The stock market has soared more than 75 percent in the past five years, yet many pension funds, where many middle-class workers should benefit from the market’s rise, continue to struggle, jeopardizing benefits for the workers who were counting on them in retirement.