Vehicles pass construction site on eastbound Interstate 80 in Sacramento, Calif., in October. (Rich Pedroncelli/Associated Press)

HOUSE AND Senate legislators concluded months of tense negotiations this week, agreeing on a transportation bill that will allocate $305 billion to roads, rails and bike paths during the next five years. Leaders patted themselves on the back for meeting a major national need in a bipartisan way. You can hold the applause.

True, the bill is something of an improvement over Congress’s recent habits. It is long-term, so state transportation planners and businesses can anticipate the size and shape of federal transportation funding a few years out. The bill preserves a sizeable chunk of money for public transit. It includes double-digit-percentage increases in spending on both roads and transit. Meanwhile, it streamlines federal construction permitting. Given the nation’s infrastructure needs, all of that represents progress.

But lawmakers failed a simple test in how to pay for the bill. The federal gasoline tax once funded the national highway tab, and for good reasons: It’s predictable, it’s sustainable and it’s fair, ensuring that drivers pay for the roads according to how much they use them, rather than asking others to subsidize their driving. But Congress hasn’t raised the tax since 1993, letting it languish at 18.4 cents per gallon even as inflation and other factors eroded the value of the revenue it produced. For years, the obvious solution has been to raise the gas tax to a suitable level.

Congress did not embrace the obvious solution. Instead, lawmakers resorted to a variety of gimmicks, one-time funding sources and flat-out bad policies to raise the $70 billion they needed to supplement revenue from a frozen gas tax.

The government will sell several billion dollars’ worth of oil from the Strategic Petroleum Reserve. It will divert money from airline and cruise ship passenger customs fees. Most concerning, the bill shakes down the Federal Reserve. The Fed already remits most of what it earns on its holdings to the treasury, keeping a share to preserve its ability to weather losses and respond to potential crises without printing money. That system has worked well. Now lawmakers will raid the Fed’s surplus account to fund infrastructure and will cap the amount the Fed can hold in the future. Not only is this a poor offset — the government wouldn’t be raising any new money, just moving it from one federal entity with funding needs to another — it is also an awful precedent. The Fed should have the independence to operate with the financial buffer it deems necessary. Its reserves should not be used in a legislative funding shell game.