Although almost everyone still thinks it will pass, the nickel-a-gallon increase in the federal gasoline tax -- supported by almost everyone from President Reagan to House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) -- is in a little trouble in Congress.

There is just a twitch of nervousness among supporters who feel that the legislation has become so ensnared in difficult equity issues that the simple idea of a tax increase to rebuild roads and provide jobs could end up a victim of the process.

The proposed tax increase is more than just a user fee. It is part of the first major revision in four years of federal highway and transit programs and taxes collected to pay for the programs through the Highway Trust Fund.

Issues that usually take months to compromise must be resolved in hours and days of this short, lame-duck session, and time has become a problem. There are at least four such issues:

How will states share income from the gasoline tax increase?

Will states with financial problems have to raise their own taxes to be eligible for their share of the money?

How much more must truckers pay?

Will cities and the administration be able to resolve a significant difference of opinion on money for mass transit?

Additionally, environmentalists complain that the bill emphasizes unneeded and controversial interstate highway construction while reducing environmental safeguards.

There is also pressure from conservatives to suspend Davis-Bacon wage protection on highway construction, which they say would create more jobs, and there is concern that federal highway standards are so inflexible that some states will not be able to use their money.

Despite these problems, Transportation Secretary Drew Lewis remained confident at the end of last week that the tax-and-repair proposal would pass, and so did major congressional leaders. But "we know this isn't going to be any cakewalk up here," Lewis has said several times, and he has spent his time seeking compromises.

However, he was unable to placate the truckers, who are incensed and pose a formidable lobbying threat to the proposal.

The question of how states share federal highway funds is known arcanely as the "donor-donee issue." States want to be donees, not donors; they want to take more out of the fund in grants than they contribute in gasoline taxes.

States with large populations tend to be donors because they have more people buying gas and paying tax.

Highway Trust Fund money is parceled to the states under a formula that redistributes from the haves to have-nots. That has made it possible for Interstate 90 to run grandly across North Dakota as well as for Interstate 5 to traverse the length of California.

Under the current formulas, 37 states are recipients (donees), about three break even and 10 collect more than they pay, or are donors. Some of those 10 include those in the upper Midwest hit hardest by unemployment, areas that could use jobs and do not want to see tax money shifted from their states to others such as Florida, to name one example.

This political problem is such that Sen. Robert W. Kasten Jr. (R-Wis.) told Lewis on Friday that he will offer an amendment to guarantee that all states get back at least 85 cents in federal highway grants for every $1 they contribute in highway taxes. His state, he said, will receive only 68 cents in benefits for every $1 of tax revenue if the gasoline tax goes from 4 cents to 9 cents.

Lewis said he could live with the 85-cent rule if it applies to programs other than the interstate highway system. On the interstate, however, he said, "If there were no donor states, Montana could pay only for the signs on its interstate highways."

Then there is the issue of matching funds. Under federal highway programs, states pay between 10 and 25 percent of the total cost of a project, depending on whether it is an interstate highway (90 percent federal) or a secondary project (75 percent federal).

Some states, as many as 17 according to some estimates, will not be able to raise this matching money. "One of our concerns," a state-watcher said, "is that to meet matching requirements some states would have to shift money from maintenance to matching. The question is whether that's a good thing to do.

"In the short term, it will produce a rather ironic situation where there is massive new money for the interstate system, but little for the rest." That concern echoes the complaints of environmental groups.

Lewis is trying to find a way to advance hard-pressed states some money, as in the past. However, a Senate staff member noted, "We know from experience that one year later, the advance will have to be forgiven; we've gone through it in several programs."

Until Thursday night, the American Trucking Associations supported the nickel increase but opposed Lewis' proposal to increase dramatically non-fuel taxes paid by the heaviest trucks because, Lewis argues, the heaviest trucks do the most damage to the highways.

The House Ways and Means Committee passed slightly modified but heavy non-fuel taxes on truckers Thursday night. The truckers were gearing up over the weekend for an all-out assault on the nickel tax since, under House rules, the revenue package is not subject to amendment.

The ATA argues that the increase on heavy trucks will be more than the net revenue heavy truckers made last year amid a severe recession. "We can't just pass it through," ATA general counsel Nelson Cooney said, citing "cutthroat competition among truckers" who must price low to stay in business because of deregulation.

The nickel tax includes a plan to dedicate 1 cent of the revenue to transit capital programs such as new buses, subway cars and shops. The money could also be used for new rail systems, such as one Houston is planning, according to a compromise Lewis announced last week.

The new tax would raise about $1.1 billion for transit annually. At the same time, the administration wants to eliminate an existing $1 billion federal aid program for transit operating costs, such as driver salaries.

Federal transit aid of any kind has little support in the White House yet has a substantial bipartisan urban constituency on Capitol Hill.

Last week, Republican Sens. Alfonse M. D'Amato (N.Y.) and Richard G. Lugar (Ind.) introduced a bill that would continue the operating aid program and support the nickel increase. If transit operating aid lives, there is concern that Reagan would simply veto or pocket veto the whole package -- taxes, jobs and all.