Former Virginia House majority leader James M. Thomson, thwarted by local opposition in his efforts to win an Alexandria judgeship, said yesterday he will seek in Richmond the endorsements he has failed to win in Northern Virginia.

A terse announcement by Thomson, an Alexandria lawyer, said he will ask members of two legislative committees "to make a determination as to my qualifications" for the bench. But Thomson, who served 22 years in the legislature and still has many close friends there, stopped short of saying that he would allow his name to be put in nomination for the judgeship.

Although his statement brought cries of anguish from his Alexandria critics, it was viewed sympathetically by many legislators in Richmond and some lawyers in Alexandria.

None of the legislators willing to be quoted, however, said they expected Thomson could win the judgeship to be filled by a vote of the legislature.

"I don't think it would be very smart of Jim to try for the nomination," said one Democratic House member who was friendly with Thomson during his years in Richmond. "I'm not sure anyone of any influence would nominate him under these circumstances," this source said.

The Alexandria Bar Association last week resoundingly rejected Thomson's bid for its endorsement and instead backed veteran trial attorney Albert H. Grenadier.

Additionally, a citizens committee appointed by Democratic Del. Richard R. G. Hobson, last week also endorsed Grenadier, who has since picked up the personal endorsements of both Hobson and Del. Elsie B. Heinz, the city's other Democratic legislator.

Endorsements by local bar associations and the local Democratic legislators are regarded as crucial to anyone seeking a judgeship in Virginia, according to those familiar with the General Assembly's pattern of selecting judges.

Marvin D. Miller, an Alexandria attorney who had opposed Thomson's candidacy, called Thomson's announcement yesterday "outrageous" and "shameful."

"It's outrageous for this man to so blatantly flout his political ambitions. They represent the type of Virginia that used to exist years ago, in which feudal control was exercised by a small group of white males over the rest of the state, with no interest in anything but themselves. His announcement shows no consideration for the people of the city, and no respect for the bar association," Miller said.

In Richmond, one Democratic House member took a pragmatic political view of Thomson's announcement. "I just couldn't see opposing the local delegation [Hobson and Heinz]. I might need them on a judgeship [nomination] in my district sometime. Jim isn't here anymore. He doesn't have a vote," the legislator said.

Until his surprise defeat in 1976, Thomson was a major power in the 100-member House of Delegates. He was opposed that year by a coalition of women activists and blacks, and lost his seat to Republican Gary R. Myers.

Both blacks and women's groups have continued to fight Thomson's efforts to win the $42,500-a-year judgeship, arguing that his statements have shown him to be antiblack and antifeminist.

Several lawyers in Alexandria who know Thomson speculated yesterday that his announcement was prompted in part by his wounded feelings at losing the local endorsements and his hope that endorsements and his hope that endorsements by the legislative committees would place him in consideration for another job on the Alexandria bench if another vacancy occurs. The position he has sought is the seat being vacated by Chief Circuit Judge Franklin P. Backus, who is retiring Feb. 1.

"I believe he [Thompson] feels his qualifications for a judgeship have not been certified by anyone," said one lawyer who knows Thomson.

Alexandria Circuit Court Judge Wiley Wright is being mentioned for a recently created seat in federal district court in eastern Virginia. If he can win that position, a second vacancy would be created on the Alexandria court.

Under Virginia law the legislature elects judges if the vacancies occur while the assembly is in session. This practice gives Democratic legislators, who vote in a bloc on judicial nominations the power to select judges. Judicial nominees are first picked in Democratic caucuses and then formally elected by members of each house.

However, if a vacancy occurs while the assembly is not in session, Republican Gov. John N. Dalton could name the new judge and few legislators say Dalton would name a Democrat.