WASHINGTON — The banking industry scored a surprise victory on Thursday when the House voted to pay for part of a new highway bill by draining a rainy-day fund at the Federal Reserve rather than cutting federal payments to some of the nation’s largest banks.

The Senate, scrounging for road-building money, voted earlier this year to reduce the Federal Reserve’s annual dividend payments to large commercial banks, saving about $17.1 billion over the next decade. The House was to follow suit, but after loud protests from the big banks, its final version of the highway bill preserves those dividends and instead requires the Fed to provide $59.5 billion over 10 years instead of putting the money into an account intended to cover potential losses.

Now congressional negotiators must decide which to hit, the Fed or the banks.

The House vote, by a margin of 354 to 72, is a triumph for banking industry lobbyists who bitterly opposed the Senate’s plan, warning of terrible but unspecified consequences. But some independent experts criticized both measures for picking on a pair of popular villains rather than raising infrastructure funds in more logical ways, for example, by raising the federal gas tax.

“They’re both bad,” said Aaron Klein, director of financial regulatory reform at the Bipartisan Policy Center, although he noted Congress has a history of tapping the Fed’s reserves.