WASHINGTON — As Congress scrambles to finish its work before the end of the year, relief for victims of this fall’s devastating California wildfires is in limbo.

Federal funding for a chunk of the government expires Friday, and Congress is scheduled to wrap up for the year a week later. Caught up in the broader fight over spending and the looming legislative deadline is help for Californians affected by the Camp Fire in Butte County and the Woolsey Fire in Southern California, which combined killed at least 91 people.

Two main pieces of legislation affect the thousands of people who lost their homes and possessions: a broad government spending bill and a tax package. Neither is guaranteed to pass.

Despite the short time frame and crowded agenda, lawmakers are holding out optimism that a deal for California disaster aid will emerge.

“I hope so,” said House Democratic leader Nancy Pelosi of San Francisco. “We’re in the course of all those negotiations.”

Gov. Jerry Brown asked lawmakers to add $9 billion in aid for fire victims to the year-end spending package, and a spokesman for Senate Majority Leader Mitch McConnell, R-Ky., said the request is under review. However, the overall funding bill is caught up in a dispute over whether Congress will approve billions of dollars for President Trump’s proposed wall on the Mexican border, and prospects for a resolution are murky.

In a tax package that was debated on the House floor this week, lawmakers have included provisions that would allow people who have property in California fire zones to tap their retirement funds early without penalties and tax incentives for employers to keep workers on staff during rebuilding. The rest of the bill includes reforming the Internal Revenue Service, changes to retirement savings and fixes to the Republicans’ 2017 tax-cut bill.

Democrats, however, complain that they were surprised by the bill and that it is being needlessly rushed. The package was unveiled Monday and hit the floor just days later, bypassing committee hearings. Democrats say there were no negotiations on the bill, though Republicans maintain they invited Democrats to participate and that much of it draws on previous bipartisan compromises.

House Democrats also argue that any cleanup to Republicans’ tax cuts shouldn’t be considered until they retake the majority. They say the tax breaks it includes for people affected by wildfires and other disasters should be structured to apply to all declared disasters, not just the handful named in the bill.

While House Majority Leader Kevin McCarthy, R-Bakersfield, pointed to the tax bill as a source of relief for California fire victims, Pelosi pushed back.

“One way (fire relief) won’t get done is by their frivolous package that they put forth,” Pelosi said, “which wasn’t even fair in terms of funding for disaster relief.”

Democratic Rep. Mike Thompson of St. Helena asked Ways and Means Committee Chairman Rep. Kevin Brady, R-Texas, in a letter obtained by The Chronicle to include a provision granting tax relief evenly to all disasters. Instead, the committee produced a package applying only to a list of specific incidents.

“You’re at the whim of, in this case, the chair and the majority, and it’s just not fair to do that,” Thompson said. “We shouldn’t have to come in and go through these different gyrations in trying to get victims’ needs taken care of.”

Fire victims, he said, should not have to wonder amid the trauma of a disaster, “‘Am I going to qualify for this? Am I going to qualify for that?’”

Brady said it is crucial to deal with disaster aid before Congress adjourns and left open the possibility that the relief provisions could move even if the overall tax package stalls. But he disagreed that such provisions should be general.

“These disasters are different from each other, and you want them tailored to each of those,” Brady said.

He added, “I don’t think one size fits all.”

Even if the House passes the bill, the Senate has made no commitment to take it up. And Democrats could block it from moving forward if the chamber does consider it.

The biggest priority for Californians — Brown’s request for $9 billion in aid — is caught up in the game of chicken over the border wall. Trump and Republicans are pushing for $5 billion for his long-promised barrier along the U.S.-Mexico line. Democrats are insisting he can accept the $1.6 billion for border security they’ve agreed to.

If a deal can be reached, a supplemental package for wildfires and other disasters could be included.

In addition to having two Californians in House leadership in Pelosi and McCarthy, the effort could be bolstered by lawmakers from other states that have been devastated by disasters this year.

Rep. Mario Diaz-Balart, R-Fla., whose state was battered by hurricanes and who is involved in funding discussions, said it’s crucial that Congress not delay relief approval until 2019. He added that even if the case-by-case disaster-funding process causes headaches, there’s no real alternative.

“I think the supplemental process is probably going to be with us for years to come,” Diaz-Balart said.

One piece of wildfire-related legislation that is likely to pass Congress is the farm bill, which includes funding for forest management — an issue Trump and Interior Secretary Ryan Zinke zeroed in on even as California’s fires burned.

Rep. Jeff Denham, R-Turlock (Stanislaus County), who is on the conference committee reconciling competing versions passed by the House and Senate, said the package “will allow us to clear the old underbrush as well as follow a timber harvesting plan that will keep our forests safer, cleaner, and a forest management plan that conserves our water.”

However, he declined to give details before an agreement on the overall bill that conferees have reached in principle is presented to the House and Senate.

Thompson, meanwhile, said he had been told that the forestry language “really isn’t anything controversial, nor does it do a lot.”

Tal Kopan is The San Francisco Chronicle’s Washington correspondent. Email: tal.kopan@sfchronicle.com Twitter: @talkopan