Wall Street banks, and Wall Street investors, have already spirited away $700 billion worth of taxpayer bailout money. But it's not enough. They want more and more of your money - and they're willing to leave you literally stranded, without a bus or rapid transit car in sight.

If it sounds like a nightmare, that's because it is. And without congressional action, local transit agencies like BART, S.F. Muni and Caltrain could be bankrupted by obscure financial agreements they entered into long ago with these banks and investors.

It doesn't matter that the deals have been sworn off by federal officials and invalidated by the Treasury Department. And it certainly doesn't matter that taxpayers, businesses and cities rely on these transit systems to keep life moving.

What matters is a tax shelter.

Beginning in the 1980s, a variety of government agencies (primarily urban transit agencies and rural electric co-ops) entered into complicated sale-leaseback transactions with private banks and companies. In the contracts, the government agencies "sold" their assets (railway cars, electric lines, a 911 system) to the private companies, and then leased them back. San Francisco's Muni, for instance, sold its light-rail fleet for $460.7 million. The purpose of the sale was to allow the private companies to obtain a hefty tax deduction via asset depreciation. (Government agencies cannot depreciate their assets because they do not pay taxes. That's why the asset depreciation section of the tax code is useless to them.) In exchange, these private companies would give the agencies between 5 and 7 percent of the entire sale in cash - which the cash-strapped agencies usually used to fund operations, maintenance or capital investments.

Never mind that this enterprise was clearly a blatant abuse of taxpayer money - federal transit officials supported the deals for many years. The agency that balked was the Treasury Department, which estimated about $4.4 billion in lost revenue from these sham sales in 2004 alone. Starting that year, the Treasury denied all depreciation deductions for these deals, making them worthless to the banks and investors. So the investors simply found another way to get their money - buried in the fine print of the contracts.

One of the provisions of the deals was that if the government agencies' guarantor (an insurance company, often AIG) went bankrupt or came close to it, the agencies themselves either had to find a new guarantor or pay enormous termination fees to cancel the agreements. Well, guess who came close to bankruptcy in recent months? AIG. And the devastation in the rest of the insurance industry, along with continued instability in the financial markets, made it impossible for the government agencies to find new guarantors. So the agencies are left with enormous bills, for millions of dollars, that they cannot pay.

The agencies have two choices: fight the fees in court, or beg Congress to do something, fast. Fighting the fees in court carries an enormous risk.

"If they lose, they'd have to come up with an amount they can't possibly come up with," said Joe Bankman, Ralph M. Parsons Professor of Law and Business at Stanford Law School. "And if they're in default in this agreement ... they could see all their other financing arrangements dry up."

Fortunately, there is legislation pending in Congress. Sen. Robert Menendez, D-N.J., and Rep. John Lewis, D-Ga., have introduced legislation that would levy a 100 percent excise tax on any proceeds private companies reaped from the leaseback deals. It's not the most elegant solution, but it would provide investors with enough of a disincentive to leave the agencies alone. And it's the only possible relief for transit agencies, and the commuters who rely on them, around the country.

That doesn't mean it will pass. The financial industry hates it, and had the clout to crush a mild bill to crack down on the shelters earlier in this decade. This time around, the stakes are even higher. If Congress wants to keep the trains running, they must pass it.