In a sharply worded ruling, a federal judge in Alexandria yesterday blocked the Justice Department from cutting federal funds to Fairfax County and criticized U.S. charges that the county discriminates against blacks and women.

U.S. District Court Judge Oren R. Lewis, in granting an injunction sought by county officials, said the government's sought by county officials, said the government's threatened cutoff of 16 Law Enforcement Assistance Administration grants would cause "irreparable harm" to Fairfax resident.

The LEAA funds amount to about half a million dollars and were due to be stopped on Friday.

The Justice Department filed suit on Dec. 19, charging that Fairfax County discriminated against blacks and women in hiring and promotions and that it employs blacks and women in "lower-paying or less desirable positions" than white males.

Under federal law, federal funds must be stopped within 45 days after filing of a discrimination suit unless an injunction is granted.

John F. Herrity, chairman of the Fairfax County Board of Supervisors, said yesterday's ruling was "no surprise to me. The judge told them they were on a fishing expedition. They are still trying to find something."

A spokesman for the Justice Department said government lawyers had not read the ruling and could not comment.

Lewis has repeatedly criticized the government for its handling of the suit, and did so again yesterday.

"The United States should never charge a local governing body with violating its antidiscrimination laws without being prepared to prove the charges. They have not only done that in this case -- they want to cut off the grant funds prior to determining whether the charges are true or false," he said.

Lewis indicated that the county probably would win the suit, scheduled for trial on or before April 1, "unless the United States comes up with more facts than they admit they now have."

Referring to a Jan. 19 hearing on the threatened LEAA fund cut-off, Lewis said, "The United States admitted they had no facts to support the charges against the defendants except those alleged in the complaint -- and said they were not ready for trial and needed six months... to complete their investigation."

Lewis said yesterday the government's claim at the Jan. 19 hearing had rested largely on a statement by Herrity during a television interview that the LEAA-funded programs were "worthless."

Herrity said yesterday, "I made a statement that a lot of what they do is perhaps a waste of money, but I didn't infer they were worthless."

The money the government hoped to hold back is for 1979 programs to aid juveniles, give medical assistance for victims of "domestic violence," and fund a mobile "crisis team," personnel for an alcoholic halfway house and a work release counselor.