SEPTA commuter trains had more passengers than ever in the year that ended June 30, carrying just over 36 million riders, SEPTA officials said Monday.

The trend was mirrored nationwide, as public transit in general and trains in particular have been gaining riders in recent years.

High gas prices, congested highways, relatively low fares, and a growing preference among young people for transit have all contributed to the rising number of passengers, transportation officials said Monday.

SEPTA Regional Rail trains carried 36.0 million riders, up from 35.3 million in fiscal 2012 and above the previous record of 35.5 million in 2008. As recently as 1993, SEPTA carried just 19.2 million riders.

SEPTA trains also recorded their best on-time performance in fiscal 2013, arriving within five minutes of schedule 93 percent of the time, deputy manager Jeffrey D. Knueppel said. The previous high was 90 percent on time in 2011.

Among the big gainers for SEPTA were the Trenton line (up 9 percent), which parallels construction-plagued I-95, and the Media line (up 14 percent).

Nationwide, 466 million passengers were carried on 29 commuter rail systems in 2011, up from 280 million on nine systems in 1980.

"People like them," said Art Guzzetti, vice president of policy at the American Public Transportation Association in Washington. "And there's a generational trend going on that's very real."

"Baby boomers had a love affair with the car," Guzzetti said. "Now times are different. Now, young people find freedom in different ways, with cellphones or texting. It's not all about a car."

SEPTA officials managed to wring bad news from the good, warning that old equipment and infrastructure could soon mean less-reliable service and cutbacks in routes.

"This could be the high point," said Richard Burnfield, SEPTA's chief financial officer. "If we don't start investing in infrastructure, it's going to go downhill."

SEPTA and other transit agencies are seeking more state money, following the legislature's failure to approve a transportation-funding bill before its summer recess. Gov. Corbett has urged the lawmakers to take up transportation- funding proposals when they return in September.

As the agency waits for action in Harrisburg, the SEPTA board is planning to approve a $640 million operating budget this week to allow trains, buses, and trolleys to continue running through December.

SEPTA has a $5 billion backlog of "state of good repair" projects, and more than half of that amount is on commuter rail.

And despite adding 120 new Silverliner V railcars to the system over the past three years, two-thirds of the rail fleet dates to the 1970s. Many trolleys are even older, some dating to the 1940s.

"It's critical that the next transportation bill provide adequate funding to advance railcar procurements to replace the Silverliner IVs and the trolleys, or you will see the system shrink," Burnfield said.