Presidential candidate Edward M. Kennedy got a pair of timely boosts yesterday as two key union presidents -- Douglas A. Fraser of the United Auto Workers, and Fred J. Kroll of the Brotherhood of Railway and Airline Clerks -- announced their support of his challenge to President Carter.

Fraser, whose 1.4 million-member union played an important role in helping Carter win the Democratic nomination and the presidency in 1976, scheduled a press conference for this afternoon to announce his endorsement of Kennedy.

Kroll said he had filed at his home in Pennsylvania for election to the Democratic National Convention as a delegate committed to Kennedy.

Both men said their endorsements were "personal," but officials of both unions said the presidents' decisions made it probable that the unions would back Kennedy for the Democratic nomination.

The endorsements come as Kennedy's once high-flying candidacy is in trouble. The Massachusetts senator has lost his lead in the opinion polls and seems headed for a defeat next Monday when Iowa Democrats caucus in the first voting of the 1980 election.

That was apparently one of the reasons Fraser chose to make his announcement today. "We did it now because he needs it now," a union official said.

It is not clear whether Fraser's announcement will have any impact on the upcoming Iowa contest, because UAW locals there are already working hard on Kennedy's behalf.But the backing of the union president should help Kennedy in other states with large UAW memberships.

The backing of the UAW is potent in Democratic politics because the union is, by definition, most powerful in the big industrial states that are Democratic strongholds. The UAW was an important asset for Carter in 1976 in Iowa, Michigan, Ohio, Wisconsin, and Florida, where thousands of retired auto workers now live.

Carter has worked hard to maintain relations with the union since 1976. Fraser's predecessor, Leonard Woodcock, was named U.S. ambassador to China when the two unions reestablished relations. Late last year the administration worked closely with Fraser to develop a plan for federal aid to shore up Chrysler Corp., the financially troubled auto maker that employs 94,000 UAW members.

On Sunday, Vice President Mondale made an impassioned plea for UAW support in an address before the union's Community Action Program.

"I come before you tonight as a person who has never run for office without your support," Mondale said. He told the apparently receptive audience of 1,000 UAW delegates that their support "will be central to the outcome of the 1980 election."

UAW officials made it clear yesterday that they have no complaint with Mondale, a strong pro-labor liberal, but said they think Carter has been ineffective in winning congressional support for labor's legislative initiatives.

Fraser has differed publicly with Carter on one key issue, national health insurance. He strongly backs Kennedy's comprehensive health insurance plan, and says Carter's substitute proposal is inadequate and unlikely to pass in Congress.

Kroll said he signed on with Kennedy because "his instincts for labor issues and labor people have always been right. I'm not anti-Carter, but I'm very pro-Kennedy."

Kroll's union has 235,000 members. It endorsed Carter in 1976 after he won the Democratic nomination.