As trucks and planes began to ellipse the need for trains in the 1970s, the federal government struggled with what to do with 270,000 miles of tracks being largely abandoned by the struggling railroad companies. In 1983, Congress came up with a brilliant solution: turn them into recreational trails. The Rails-to-Trails program, converting the nation’s abandoned railroad tracks to paths for bikers, hikers and joggers, created popular recreation trails while preserving the right of railroads to convert them back to rails at any time -- preserving the rail system for future use. Best of all, the program was essentially cost-free.

But it turns out there really is no such thing as a free lunch. According to a report in the National Law Journal this week, due to a series of court opinions over the program, the government is paying out millions of dollars each year to landowners whose property abuts the trails. When all is said and done, the legal costs could reach $500 million.

At issue is whether the program is changing the value of the landowners’ property and whether they are entitled to compensation. Those suing the government – and there are 8,000 property owners with pending claims – argue that the conversion from rail to trail constitutes a new use of their property for which they deserve compensation under the “takings” clause of the Fifth Amendment. When the railroads began building tracks across the country, rather than buy the land for the tracks they received permission to use private property for the specific purpose of running the trains – what is called an easement. The landowners argue that the original easements allowed use of their land for railroads but not for trails.

At issue in many cases is not whether trails were part of the original easement but whether they substantially alter the value of the property. In a South Carolina case brought in 2010, the federal government argued that value of the land should be calculated to include the railroad easement, so that changing it to a trail won’t significantly change the property’s value. But the plaintiffs, who won a major victory in the case, argued that the original value did not include the railroad easement, so that the trail did have a big impact on the value of their land.

The amount of money at stake has given rise to an entirely new area of legal practice: takings class actions. Like in other class action suits, attorneys are entitled to fees if they win and earn sizable share of the settlement as well. The South Carolina case settled for $33.5 million, the largest yet for these cases. The lawyer who won that suit, Thomas Stewart of Kansas City, Mo., won $11 million in fees for the case. He has brought 24 cases against the program and won every time. Stewart told the National Law Journal he has more cases lined up and that "We don't bring 'em unless we can win 'em.”

Attorneys on both sides of the issue told the National Law Journal that the whole situation is flawed. "The irony is that the U.S. doesn't even get a deed,” said Andrea Ferster, general counsel for the nonprofit Rails-to-Trails Conservancy. “At the end of the day, [the claimants] still get to keep the property.”

One lawyer who has collected hundreds of thousands of dollars by representing plaintiffs in trail cases agreed. "Why should U.S. taxpayers have to fund the acquisition of property the federal government doesn't even own?"