A U.S. District Court Judge yesterday denied a motion by newly elected Washington Teachers Union President James D. Ricks that would have prevented Labor Department officials from opening sealed elections documents without having observers present.

Ricks has said he requested the motion based on information that Labor officials, as part of their investigation of the teachers union election March 19, intended to secretly tally 17 uncounted, challenged ballots.

However, Paul Williams, a Labor Department spokesman, said the department "never had any intention of counting the challenged ballots without having observers present."

Last month Ricks edged out longtime teachers union president William H. Simons by only four votes in what has become a disputed election.

The Labor Department, which monitored that election by federal court order, is now conducting an investigation based on complaints from Simons, who wants a recount, and others.

Ricks attorney, Oliver Long, said that Ricks' objection was to the Labor Department counting the challenged ballots in secret or opening any unused ballots without Ricks' observers present.

Judge Aubrey E. Robinson Jr., who threw out the union's May, 1981 race because it was not conducted by secret ballot and ordered the most recent election to be conducted by mail, yesterday denied Ricks' motion for a temporary restraining order or preliminary injunction against the Labor Department.