Ridership on the nation’s trains and buses hit one of the highest levels in decades, with officials crediting high gas prices, a stronger economy and new technology that makes riding public transit easier. In 2011, Americans took 10.4 billion trips on mass transit — which includes buses, trains, street cars and ferries, according to the American Public Transportation Association. That’s a 2.3% increase over 2010 and just shy of the number of trips in 2008, when gasoline spiked to a record national average of $4.11 a gallon. “As people get jobs and go back to work, they get on mass transit more,” said Michael Melaniphy, president of APTA. “And then when people look at gas prices, they really get on transit more.”