The bonanza of dollars for road and bridge repairs that Washington area officials are hoping to get from Congress will take a costly detour before it gets to Northern Virginia.

The Virginia funds from the anticipated gasoline tax will be channeled through the state capital in Richmond where bonanzas for the Washington area have a way of dwindling fast.

"If the state gets the money and they go with the same formula they've always used, what good is that going to do Fairfax?" said Fairfax County Supervisor Joseph Alexander. "I don't think there's any question the current allocation is unfair."

Virginia allocates highway funds through a complex formula that rapidly growing areas such as Fairfax, Prince William and Loudoun counties long have complained short-change them at the expense of rural territory. A study commissioned by the General Assembly recently concluded that the formula is unfair, and it recommended changes that for the most part would increase the flow of funds to Northern Virginia.

Many legislators and local officials are pessimistic that the General Assembly will change the formula drastically this year or in time to affect the initial revenues of any federal gasoline tax increase. The state budget is pinched, legislators must run for reelection next year and the uncertainty over the 5-cent gasoline tax may provide an excuse for delay, several officials said.

Some of the revenues from the 5-cent gasoline tax increase now being studied by Congress would go to mass transit, and Alexander said Washington could receive enough to build an additional 10 miles of the Metro rapid rail system. In addition, Board Chairman John F. Herrity said Northern Virginia officials are lobbying to include language in the gas tax bill that would specifically direct road money to this region. "For the last 20 years we've been getting ripped off by the highway department," Herrity said.

Fairfax holds more than 10 percent of the state's population and vehicles but receives only 4 percent of Virginia's road funds, according to Robert L. Moore, the county's chief of transportation planning.

Altogether, the secondary road system in Fairfax, Prince William and Loudoun needs almost $1 billion of improvements, according to the state's own estimate. This year the system in those three counties will receive about $7.6 million in aid.

"There isn't enough money anyway, and what they have they don't allocate right," said Supervisor Thomas M. Davis III. Frustrated by that situation, the county last year went to the voters for permission to sell bonds to finance is own roadbuilding program. That will help the congestion to some extent, Davis said, but it has also relieved some of the pressure on politicians to lobby for more state aid.