The Justice Department yesterday filed a $4 million suit against General Motors Corp., accusing the nation's largest automaker of endangering its customers by trying to cover up braking defects in its 1980-model X-body cars.

The petition also demands that GM recall all 1.1 million of the cars suspected of having braking problems.

The suit was filed on behalf of the Department of Transportation's National Highway Traffic Safety Administration. But several hours after announcing its action against GM, the NHTSA was accused of engaging in a coverup of its own.

Charges against the safety agency were made by Rep. Timothy E. Wirth (D-Colo.), chairman of the House subcommittee on telecommunications, consumer protection and finance, which oversees the NHTSA.

Wirth said the results of a seven-month investigation of the NHTSA, conducted for his subcommittee by the General Accounting Office, "indicates that serious problems existed in the National Highway Traffic Safety Administration's investigation" of the X-body braking defects. The government inquiry's faults included "delays, coverups and the withholding of critical life-saving information from the public," Wirth said.

Wirth's committee will release a draft report of the GAO's findings at a hearing Friday.

Transportation and NHTSA officials denied engaging in a coverup. "This thing has been in the works for eight or nine weeks," said one transportation department official, attempting to turn aside speculation that the lawsuit was filed in an effort to divert attention from the GAO report.

The NHTSA probe of the braking defects--affecting the 1980-model Buick Skylark, Oldsmobile Omega, Pontiac Phoenix and Chevrolet Citation--"has been going on for four years," the transportation official said. "Given the history of the case and the record of obfuscation" on the part of GM, "we decided that this the suit was the most appropriate way to get a fix on the cars," the official said.

Transportation Secretary Elizabeth H. Dole said the suit "is one of the most serious" actions taken by NHTSA against an automaker since the enactment of the National Traffic and Motor Vehicle Safety Act of 1966, which established the highway safety agency.

GM officials, who said they were surprised by the lawsuit, disagreed.

The complaint "is especially unwarranted in view of the fact that General Motors Corp. has cooperated extensively with the National Highway Traffic Safety Administration to develop the facts, which will show clearly that no further recall or other corrective action is needed," said William L. Weber Jr., GM's assistant general counsel.

"We categorically deny the government's assertion of misrepresentation. Accordingly, we will vigorously defend against the lawsuit," Weber said.

GM announced last February that it was recalling 240,000 of the X-body cars because of the braking problem, in which the rear brakes could lock during moderate to hard stops, causing loss of driver control.

GM also had recalled 41,000 of the cars in 1981 after reports that brakes were locking; but both the company and the safety agency concluded that the first fix was inadequate.

The NHTSA has received more than 1,740 complaints about brakes locking in the X-body cars, which were introduced by GM in 1979. The complaints include accidents in which 71 people were injured and at least 15 fatalities occurred, the government said.

The government also charged that GM had started production of the cars in 1979 "even though it was fully aware that the brake system was defective" and subsequently "intentionally . . . made numerous false statements in an effort to cover up the extent of the defect.