To save money on gas and parking last week, Samantha Brown; her mother, Kathy; and two friends parked their Honda in Fort Washington and rode SEPTA's R5 train into Center City.

It was the last leg of a trip from Mechanicville, N.Y., and they had already paid $60 for gas. They shelled out $40 for four round-trip tickets and, 35 minutes later, emerged into the sunshine outside Suburban Station.

"A year ago, we would have driven," Kathy Brown said. "Gas is $4.05 a gallon. It changes every day, but it only goes one way: up."

With gas prices at unprecedented levels, ridership on area trains, buses and subways is increasing as drivers leave their cars at home.

But even as mass-transit agencies such as SEPTA and NJ Transit count their newfound revenue, their own fuel costs are skyrocketing.

So far this fiscal year, SEPTA ridership is up 5 percent, or 13 million trips, from last fiscal year. The increase on Regional Rail trains is even greater proportionately - 2.8 million more trips, an 11 percent increase.

NJ Transit is setting ridership records for the sixth consecutive year, reporting more than 900,000 trips per weekday on its trains, buses and light-rail vehicles. Ridership the first three months of 2008 was up 3.5 percent over a year earlier.

Train ridership was up 5 percent, and the River Line, which runs between Camden and Trenton, had 10 percent more weekday riders than last year.

"Ridership on the system has never been higher," said Dan Stessel, NJ Transit spokesman. "Clearly, the high price of gasoline and economic forces have combined to drive people over to public transit."

On the 14-mile PATCO High-Speed Line, which connects Center City and South Jersey, ridership was up about 7 percent for the first four months of 2008. Average weekday ridership was 35,138, up from 32,952 a year earlier.

The increases in the Philadelphia region are part of a national trend.

Americans took 10.3 billion trips on public transportation in 2007, the most in 50 years and a 2 percent increase over 2006, according to the American Public Transportation Association.

Thomas Brown, an assistant professor of business administration and management at the Northeast Philadelphia campus of Holy Family University, took SEPTA's Media local to the university's commencement ceremony at the Kimmel Center on Friday. Since he's a senior citizen, the ride cost $1.

Brown, who usually drives 30 miles each way for his commute, said gas prices "haven't quite pushed me over the edge yet . . . but they're getting close." He was considering buying a Toyota Prius hybrid or taking the train regularly, he said.

"I used to take the train all the time," Brown said after his rail trip into the city. "It's much better now. . . . It was clean, fast, quiet."

Diana Antal, who lives in Center City, doesn't own a car, but she is feeling the pinch of higher gas prices, too. Her suburban pals are increasingly reluctant to drive into Philadelphia, Antal said, so on Friday she took the R3 to Yardley to have lunch with a friend.

"It's much easier to meet there than for her to drive down here and pay for gas and parking," said Antal, 33, who owns a bath-products business.

But the rising fuel costs that are squeezing drivers are being felt by transit agencies, especially those that require diesel fuel to power buses and some trains. The cost of electricity to run trains, subways and trolleys is up much less.

SEPTA pays $3.53 per gallon for ultra-low-sulfur diesel fuel, up from $2.13 last May, spokesman Felipe Suarez said. The agency has already spent $4.5 million more on diesel than it had budgeted for the fiscal year, which will end June 30, Suarez said.

In the operating budget for fiscal 2009, which was adopted Thursday, SEPTA increased its anticipated fuel costs 56 percent, to $57 million. In the current fiscal year, it budgeted $36.5 million for fuel.

It is increasingly difficult to lock in diesel prices with long-term contracts, Suarez said, as dealers are reluctant to commit with prices rising so rapidly.

So far, the increase in rider revenue has outstripped the increase in fuel costs. SEPTA is on pace to collect about $40 million more in fares this fiscal year than last, while spending about $10 million more for diesel.

Higher fuel prices "are a double-edged sword," increasing costs as well as ridership revenue, Stessel said.

At NJ Transit, a 1-cent increase in the cost of a gallon of diesel fuel translates into a $350,000 annual increase, he said. Virtually all of NJ Transit's 2,109 buses and eight of its 11 rail lines use diesel.

The retail cost of diesel is $2.03 higher per gallon than it was a year ago in the central Atlantic states, according to U.S. government figures. That's an increase of about 70 percent.

Contact staff writer Paul Nussbaum at 215-854-4587 or pnussbaum@phillynews.com.