James D. Ricks, who recently beat incumbent William H. Simons for the presidency of the Washington Teachers Union in a disputed election, is seeking a court injunction to prevent the counting of 17 challenged ballots without the presence of observers.

Oliver Long, Ricks' attorney, filed the motion for a temporary restraining order or a preliminary injunction in U.S. District Court yesterday. The motion seeks to prevent Labor Department officials, who monitored the election and are investigating a variety of related election complaints, from counting the challenged ballots or unsealing any unopened election materials without having some of his people present.

Labor Department officials, who are conducting an investigation into Ricks' same complaints and considering Simons' request for a recount, were unavailible for comment. A hearing on the motion will be held on Monday.

The election was conducted with mail-in ballots counted March 19.

Long said yesterday, "We have identified four members of the union who did not receive ballots and say they did not cast ballots and yet their 'votes' were counted."

The election was ordered by U.S. District Court Judge Aubrey Robinson. Robinson threw out the union's May 1981 election because it was not conducted by secret ballot as required by federal law.