The Equal Employment Opportunity Commission yesterday failed to stop a state-trooper qualification examination in Boston on the grounds that the test is discriminatory because it bars anyone over age 29 from taking it.

The EEOC's attempt to obtain a court order to call off the examination scheduled for today is its most aggressive effort to date to combat mandatory retirement ages and age barriers to new careers.

"Some 40-year-olds are in better condition than 29-year-olds so why shouldn't they be able to take a test to become a state trooper," said EEOC Chairman Clarence Thomas. "It's against the nature of this country, it's why you have antidiscrimination laws. People who are of any age, people who are women, blacks, Hispanics, have a right to try and compete. If a person can compete and do it then let them do it."

However, the Massachusetts attorney general's office argued successfully that the 29-year-old age ceiling for taking the test is justified "in light of the duties a state trooper has," and because the state legislature has approved a hiring scheme for troopers that set the 29-year-old age ceiling as well as a requirement that troopers retire at age 50.

Despina Billings, assistant state attorney general, argued that the 50-year-old retirement age already has been declared legal by the 1st U.S. Circuit Court of Appeals. And the 29-year-old ceiling on applicants is justified because older persons would require the same state police training, but would have shorter careers before they would be forced to retire under the court-approved rules, she said.

The EEOC has requested a Supreme Court hearing on the lower court's ruling that upheld the 50-year-old retirement. To justify the retirement age, Billings cited medical studies showing that persons over 50 have a higher incidence of heart disease and "it's impossible to weed them out ahead of time."

U.S. District Court Judge Joseph L. Tauro cited the court's earlier ruling on the mandatory retirement age yesterday in refusing to issue a temporary restraining order to stop the trooper test. Tauro also noted that the Age Discrimination in Employment Act covers persons between ages 40 and 70 and the EEOC had no jurisdiction to represent persons between 30 and 40 who were denied the right the take the troopers' test.

The judge also said the EEOC failed to prove it could win its case in a full hearing or that there was irreparable harm done by going ahead with the test and possibly seeking remedies later if discrimination is proved.

"This is . . . our most aggressive posture, we are trying to stop them before the test," Thomas said.

The EEOC has filed several other suits in an effort to begin a large-scale attack on age discrimination. Thomas said:

"In the past we have filed suits after these tests. Now we are saying the test is discriminatory because it precludes people.

"We feel you can't prevent someone 40 from being a police officer. That doesn't mean you can't fail them if there is a physical fitness requirement and they are not up to it, if you've got to do wind sprints and they can't keep up. All we're saying is people have to be treated equally unless there is a bona fide occupational qualification that goes to the nature of the job. You cannot prevent someone from taking tests or require them to retire."

Thomas said the EEOC is asking the Supreme Court to look at a case involving Trans World Airlines Inc., which requires pilots to retire at age 60.

Thomas said although the Federal Aviation Administration prohibits persons over 60 from piloting planes, there is no bar to persons over 60 being navigators.