Bendix Corp. Chairman William M. Agee, who lost a billion-dollar takeover fight last fall when his company was swallowed by Allied Corp., announced today he was giving up his posts with Bendix and Allied by June 1.

Agee, who launched the merger fight, said he was leaving Allied because of his diminished role. He will seek re-election as an Allied director on April 25.

Allied officials, including its chairman, Edward M. Hennessy, have made clear since agreeing to buy Bendix last September for $1.8 billion--ending a takeover battle between Bendix and Martin Marietta Corp.--that they did not see a major role for Agee within Allied. Although Agee was named Allied's president, in theory its No. 2 job, he was publicly given responsibility only for Bendix operations.

Before the Allied acquisition, which became effective eight days ago, Hennessy announced that his company was looking for a chief operating officer with "a different combination of skills, attributes and experience than Bill Agee," an Allied press representative said.

Agee, who was unavailable for comment, said in a statement that when Hennessy finds a chief operating officer, "it will be difficult for me to carry out the function of president of Allied in the way I would like.

"The position of chairman of Bendix will have little meaning after the integration of the two companies," Agee said.

Agee, according to an Allied official, is undecided about his future plans, although the official noted that Agee will not retire and will not seek public office.

Hennessy's search for a chief operating officer for Allied had been suspended during the merger implementation period. But Agee learned last week that the search had been resumed and decided to resign after discussing that search with Hennessy this morning, officials said.

Officials of both companies called the parting amicable, and Agee's statement said he had "the greatest admiration" for Hennessy.

Agee is "disappointed but is a realist and knows that in mergers these things happen," a company official said.

Spokesmen for the companies refused to discuss whether Agee will seek payments from Allied under his so-called "golden parachute" contract. That pact calls for Agee to be paid $825,000 a year for six years if he is fired or if he quits "after suffering a diminution in compensation or position."

In remarks to reporters last week after stockholders approved the merger, Hennessy emphasized that all such contracts agreed to by Bendix directors would be reviewed by Allied, but added that he knew of no top-level Bendix officials who planned to press for payments under the agreements.

Hennessy said Bendix officials seem "more interested in working and getting on with their jobs than pulling the chains on their parachutes. We're an honorable company and for the right cause we would honor the contracts."

In a prepared statement, Hennessy said Agee has done "a fine job" during six years as the Bendix chairman. Although his assistance is needed while the two companies are integrating their operations, Hennessy said, "we both reluctantly recognize that it is unlikely that a postion in the combined company will be available that would utilize his wide range of talents."

Agee's resignation follows the departure of Bendix President Alonzo McDonald Jr., who said Monday he quit because Hennessy "saw no role" for him.

Although Hennessy praised the talents of Bendix officials, he was critical of the players in the Bendix-Martin Marietta fight, which Agee initiated. "The whole thing was a pretty sorry spectacle for American business," Hennessy said when it was over.

Bendix, the Southfield, Mich., automotive and electronics company, began its effort to take over Marietta last summer, but the Bethesda aerospace and aluminum concern resisted and made its own offer to acquire Bendix.

The struggle ended with Allied purchasing controlling interest in Bendix in a friendly takeover that also gave Allied Bendix's 38 percent of Martin Marietta.