RICHMOND, JAN. 13 -- Northern Virginia lawmakers, who came here expecting they would have to fight to avoid losing education financing to poorer, mostly rural localities, apparently escaped unscathed in Gov. Gerald L. Baliles' two-year spending plan.

Although the governor proposed that Virginia revamp the way it distributes education aid to help relatively disadvantaged schools, he made an exception for Northern Virginia that seems likely to ensure continued higher aid levels for the region's largest school systems: Fairfax, Prince William and Loudoun counties.

In another initiative -- one that is likely to produce new state money for Northern Virginia -- Baliles asked the General Assembly to establish a fund that would virtually double the amount the state spends on housing.

The $45 million housing fund, designed to compensate in part for cutbacks in federal financing, would provide grants and loans aimed at preserving and expanding the stock of housing for "those in greatest distress," the governor said.

Other good news for Northern Virginia included the addition of 125 faculty and support positions for the area's largest university, George Mason in Fairfax.

The school would also receive salary increases that would raise the average faculty salary from $40,000 to about $48,000 by 1990.

However, George Mason would not receive money it had requested for construction of several facilities.

Citing the "cost of competing" in the Washington area's educational marketplace, Baliles recommended a new plan that for the first time acknowledges that teacher salaries in Northern Virginia are higher than in the rest of the state.

Until now, Virginia has handed out education money to localities without regard to sharp differences in pay scales for teachers around the state.

Because of other changes in the state formula, however, it is not clear how much Northern Virginia would gain under the new rules. By some estimates, Prince William and Manassas Park schools would be big winners, Fairfax County could do well, and Alexandria and Arlington schools, which are not growing, would have their state funding effectively frozen at current levels.

State officials said they could not estimate until later in the week how much money would go to individual localities under the governor's proposal.

In the absence of dollar projections, several Northern Virginia lawmakers were wary about the effect of the changes.

"I want to make sure that we'll continue to grow as we have been," said Del. Dorothy S. McDiarmid (D-Fairfax), who, as chairman of the influential House Appropriations Committee, will have an important voice in setting the new rules.

"This is a big issue for Northern Virginia, these are big bucks," said Del. Robert E. Harris (R-Fairfax). Harris said that if the increase in state education financing to Fairfax and Prince William counties is less than 15 percent, "we're behind the power curve." Student enrollments have grown rapidly in both counties.

Statistics have shown wide disparities between educational haves and have-nots around the state, both in the amount spent for each child and in student achievement. As a result, a legislative consensus appears to have emerged that Virginia must do more to increase spending and performance in poorer schools.

In his speech, Baliles took note of the issue, declaring that "such disparities in funding and quality between local school divisions are inherently unfair and counterproductive."

The governor's 1988-90 budget does recommend a number of steps designed to narrow the gap between rich and poor schools, including more spending for pupil transportation, special education, vocational education and remedial education in needier parts of the state.

Although he did not mention it in his speech, the governor made one major exception to that policy shift: a 12.5 percent differential in financing for teacher salaries in Fairfax, Prince William, Arlington and Loudoun counties and the cities of Alexandria, Fairfax, Falls Church, Manassas and Manassas Park.

Although the revision may translate into more state money for Northern Virginia, it does not necessarily mean that teacher salaries will rise faster than they would otherwise.

Nearly all the school systems in Northern Virginia already pay teachers a salary well above the state average, and the new formula appears to recognize that.

According to state budget officials, average salaries for teachers in Northern Virginia vary from $23,289 in Manassas Park to more than $35,000 in Arlington, Alexandria and Fairfax County.

Northern Virginia's schools account for about a quarter of the nearly 1 million students enrolled in public schools around the state. Fairfax County, by far the largest school system in Virginia and one of the largest in the nation, has an enrollment of 130,000 students.

State budget officials went to lengths to point out that no localities would actually lose education money under the new state formula; the pie, they said, was simply getting bigger. Nonetheless, it appeared that financing for a number of localities, including Arlington and Alexandria, would be virtually unchanged.

"Nobody loses under this plan," state Budget Director Paul W. Timmrick said in a briefing for reporters.

Education accounts for more than half of the $751.9 million in policy and program initiatives included in the governor's 1988-90 budget. Of the total budget, education is the largest single area of spending, accounting for $9.5 billion, or 42.2 percent of the $22.5 billion package.

If Baliles' budget is passed by the legislature, it would represent the third consective two-year spending plan in which education aid for localities has jumped by more than half a billion dollars.

Baliles' emphasis on education came as a relief to a number of legislators, who expressed disappointment last year when the governor did not make any major budget proposals to benefit the state's school systems.

Virginia ranks 25th among the 50 states in terms of teacher salaries, with an average teacher wage of $27,436.

The new housing fund includes $35 million from the state's general fund and $10 million from a special trust fund for energy conservation. The trust fund was fed by a number of oil companies after a court order determined they had overcharged for oil.

The $45 million fund, budgeted over the next two years, was hailed by state officials as a "bold step" for Virginia. It is intended as a first step to restore housing aid to areas that have lost large amounts of federal money because of cuts under the Reagan administration. By some estimates, Virginia has lost $100 million annually in federal housing aid since 1981.

The fund would be distributed through grants and loans for housing rehabilitation, home purchase assistance, homeless shelters and a deferred-payment borrowing plan to encourage developers to build new multifamily housing projects.