A D.C. Superior Court judge refused yesterday to dismiss charges against a Cambodian woman who alleged she was being unfairly prosecuted for her demonstration outside the Soviet Embassy while hundreds of protesters arrested at the South African Embassy escaped prosecution.

Judge Warren P. King's decision also upheld the constitutionality of a D.C. law banning "congregating" within 500 feet of an embassy with intent to demonstrate.

Ruling in the first of several cases involving demonstrators at the Soviet Embassy, King said prosecutors need broad discretion in deciding whom to prosecute and that the safety of American diplomatic personnel in other nations can be a factor in such decisions.

"Events in recent years," King ruled, "clearly demonstrate that our diplomatic personnel and citizens require different degrees of protection in different countries."

King's ruling backed a controversial decision by U.S. Attorney Joseph diGenova to prosecute only those demonstrators arrested outside certain embassies.

Washington Legal Foundation lawyers representing Vanna Om Strinko, who was arrested Jan. 28 for violating the 500-foot limit, had argued that protesters outside all embassies should be treated similarly. They said the ruling would be appealed.

The ruling "apparently gives more of a green light to the U.S. Attorney's office to continue its selective prosecution," said Paul D. Kamenar, executive legal director of a conservative public interest law firm.