The Transportation Department is preparing major legislation to overhaul the nation's crumbling highways and bridges that would require an increase in the federal gasoline tax equivalent to 5 cents a gallon at the pump.

The program has a long way to go before it becomes Reagan administration policy or an official part of its fiscal 1984 budget, but a substantial constituency was built for such a plan early this year before President Reagan spiked it "for the time being" in May because of his opposition to tax increases.

Transportation Secretary Drew Lewis, who led the earlier effort, said in a recent interview that he would not move this time without Reagan's prior approval. Nonetheless, his staff is hard at work on legislation.

"It's very clear," Lewis also said, "that either through a highway user fee, or general fund taxation, or the states assuming the responsibility -- which I don't think they can do -- somebody's going to have to address the infrastructure for highways, bridges and mass transportation. It's up to me to make it clear within the administration there is a problem."

Highway, transit and governmental sources all report that a gasoline tax increase is a major component of Lewis' budget and legislative plans because it is a logical way to finance the rebuilding of the nation's highways, bridges and big-city transit systems.

Four cents of the proposed tax would be pledged to highway programs. The other penny would go for transit capital financing. This is the same split Lewis proposed last year.

Each penny of the tax raises about $1.1 billion, so the total package would produce $5.5 billion. This also helps in the short term to reduce the federal budget deficit because more money would be collected in the early years than would be spent out of the highway trust fund.

The present federal gasoline tax -- which has not been changed since the late 1960s -- is 4 cents per gallon. Most states add their own, much larger, tax on each gallon.

The federal tax has produced steadily less revenue when inflation is figured in. As the costs of building roads have soared over the last decade, there has been no increase in money to pay for construction.

The gasoline tax increase would be called a "user fee" to make it more politically palatable to Reagan, who said at a recent news conference that there would be no tax increases -- on gasoline or anything else -- unless there were a palace coup at the White House.

Lewis' 1984 budget plans are now being presented to the Office of Management and Budget. Lewis will eventually discuss them with Budget Director David A. Stockman, who has traditionally opposed a major federal role in highway building but supported Lewis last year because of the tax increase's short-term help in reducing the budget deficit.

"All kinds of basic decisions vis-a-vis revenues still have to be made," said OMB spokesman Edwin L. Dale Jr. A gasoline tax increase, he said, "isn't anywhere now. I'm not saying it's not going to finally be a component of the package. It's really too early to say anything."

Meanwhile, Lewis and his lieutenants are willing to discuss the merits of a tax increase, but are anxious to have it understood they need White House approval to go further.

For example, Ray A. Barnhart, federal highway administrator, spoke at the recent American Public Transit Association meeting in Boston and strongly favored the penny tax increase for transit as part of the package. He stressed, however, that the White House was not sold on it.

"The message we got was that we should keep on the pressure," a transit official said.

There are increasing signs, however, that support from Lewis and Barnhart for the transit penny will be contingent on acceptance of the administration's attempt to end federal operating aid to transit systems. That aid, which was scheduled by the administration to end this year, continues to survive at a reduced level because of actions by Congress.

A spokesman for Associated General Contractors -- a key part of the coalition Lewis would have to build to push through a tax increase -- said that, in his opinion, pressure for the move has increased during the current political season.

"We've gotten all these congressmen out driving on their own roads and actually looking at the situation," he said. "We think the best thing would be multiyear legislation with multiyear highway funding."

That is just what is being drafted by Lewis' Federal Highway Administration.

Trucking interests are concerned that a gasoline tax increase would be structured in a way that would fall more heavily on them. However, they also would love to have administration backing for federal preemption of state restrictions on truck weights and widths, so an obvious political trade can be made.

"We discussed taxes with the White House staff recently," an industry official said, "and they have some internal divisions on the future of the issue. But the biggest problem is they don't have the one vote they need, Ronald Reagan's."