Federal Highway Administrator Ray A. Barnhart proposed doubling the present four-cent-a-gallon federal gasoline tax yesterday to help pay for the increasing costs of maintaining the nation's highways.

The administration has not yet agreed to such a proposal, however, and Barnhart conceded that he expected some opposition to his suggestion from President Reagan and Congress. A Treasury Department spokesman said yesterday that Treasury was not preparing such a proposal, and that Barnhart's remarks at a news conference in Indianapolis reflected Transportation Department consideration of the tax increase.

Reagan has rejected any tax increases for the current fiscal year, although many economists believe that he will have to propose some for fiscal 1983 and 1984 because the projected budget deficits by that year are so large. Doubling the gasoline tax would raise about $4 billion.

However, if all the extra tax is earmarked for new highway spending, then it may just go to pay for increased spending rather than to close the deficit, a budget spokesman said. In that case it may not be favored so much by the Office of Management and Budget.

Officials from OMB have pushed most strongly for additional taxes to close the deficit. But one commented yesterday that the president "just does not like tax incrases."

The real value of the gasoline tax, after allowing for inflation, has plunged since it was set at four cents in 1959. This makes it a good candidate for an increase. Barnhart told the news conference "the tax was four cents then and 4 cents now, and things all cost a lot more now."