President Biden scored a major victory late Friday when the House passed a $1 trillion public-works bill, but the White House faces new challenges as attention shifts to an even larger spending bill and next year’s midterm elections.

Congress is set to return from a week-long recess on Nov. 15 with a laundry list of items to complete quickly in order to avoid a government shutdown and move forward on the roughly $2 trillion education, healthcare, and climate package that has proven difficult to negotiate with the party’s slim majority in Congress.

Another complication is economic headwinds. Despite a strong rebound in hiring this year, public opinion on the administration’s economic management has been harmed by concerns about rising prices, with inflation at its highest 12-month rate in more than a decade.

Republicans won three statewide races in Virginia, a state Mr. Biden easily won a year ago, sending a warning shot to Democrats.

Mr. Klain was referring to the $1 trillion infrastructure bill that was passed late Friday night. The bill authorizes the largest federal infrastructure investment in more than a decade, with funds for projects such as repairing ageing roads and bridges, expanding internet access, and upgrading the nation’s power grid, among others.

The infrastructure bill is expected to play a significant role in Mr. Biden’s pitch to voters ahead of next year’s midterm elections, in which Democrats will seek to maintain their narrow majorities in the House and Senate.

In recent months, Mr. Biden’s approval rating has dipped. This year’s strong hiring rebound pushed the unemployment rate to 4.6 percent in October. However, because of concerns about rising prices, public opinion on the administration’s handling of the economy has lagged.

Because those benefits could take years to accrue, they are unlikely to have an impact on the rate of inflation over the next year. “The only way Democrats have a chance of keeping the majority is if the economy is strong,” Mr. Gonzales said.

Republican opponents argued that the bill was not fully paid for—the Congressional Budget Office estimated it would increase federal borrowing by $256 billion over ten years—and that only a small portion of the legislation was devoted to road and bridge reconstruction.

Last Friday, a handful of centrist Democrats blocked passage of the larger, $2 trillion bill, saying they would support it if the cost estimates matched the Congressional Budget Office’s details.

A cost analysis can take several weeks, but data tables may suffice for Democratic holdouts. Among other things, the legislation is expected to include $555 billion for climate initiatives, funding for a universal prekindergarten program, expanding healthcare subsidies, and raising taxes on very high-income Americans and corporations.

However, if it passes the House, the social-spending and climate bill will face changes in the Senate, where Democrats hold a slender 50-50 majority. Sen. Joe Manchin (D., W.Va.), a swing vote in the 50-50 Senate, has spoken out against a paid-leave provision added to the bill by House Democrats last week, raising concerns about the bill’s impact on the deficit and inflation.

Republicans are expected to vote unanimously against it in both chambers, while Democrats are using a budget maneuver known as reconciliation to pass the legislation with a simple majority in both chambers. To use reconciliation, Democrats must align the bill with a set of rules that govern the types of policies that can be passed.

Democrats may run into difficulties in ensuring that the legislation’s immigration provisions adhere to Senate rules. As part of the bill, House Democrats propose shielding illegal immigrants from deportation for five years and providing a five-year, renewable work authorization.

Lawmakers must also agree on a must-pass defense-policy bill that establishes policy and expenditures for the Department of Defense. Last week, 13 Republican senators urged Senate Majority Leader Chuck Schumer (D-NY) to bring the bill up for a vote. The Senate must vote on its bill and then conference with the House on their version of the bill to negotiate one that can pass both chambers and go to the White House.