The United Auto Workers union, which had embraced Sen. Edward M. Kennedy throughout his unsuccessful presidential campaign, yesterday announced its support for President Carter's reelection.

After a meeting with Carter, the UAW executive board said it had voted unanimously to recommend that the 1.4-million-member union formally endorse a second term for the president.

In a prepared statement, union president Douglas Fraser, long one of Carter's most vocal critics, said the board had found "clear and important differences" between Carter and Ronald Reagan, the GOP standard-bearer.

Fraser, who two months ago had said it would be difficult for the union to support Carter, called the endorsement "very enthusiastic."

"We will pull out all the stops," he said. "The choice is very clear to us and we will work as hard as we have ever worked."

The announcement followed meetings earlier in the day with independent presidential candidates John Anderson and Barry Commoner. Ronald Reagan, who claims widespread support among rank and file factory workers, declined an invitation to appear before the board.

With his new running mate, former Wisconsin Governor Patrick J. Lucey at his side, Anderson had asked the union to delay its endorsement until early October. By that time, he said "I'll become THE viable alternative to the Reagan-Bush ticket."

Anderson, whose voting record on labor issues has frequently come under attack from unions, received polite applause at the end of his remarks.

But union president Fraser later told reporters that Anderson would only "enhance the chances" of Reagan's election.

Fraser acknowledged that some rank-and-file union members now lean toward Reagan and others regard Carterr as a second choice behind Kennedy.

But he told a press conference on the White House Lawn that when the UAW membership "realizes Reagan's stands on a number of issues" a shift back to Carter will occur.

There is, he said "an absolute correlation" between high unemployment in the beleaguered auto industry and support for Reagan.

"We reject Ronald Reagan because the program he proposes would move American backward -- both economically and socially," his prepared statement said.

The announcement was seen as an important step in Carter's attempts to build bridges back to traditional Democratic constituency groups that supported Kennedy with groups of Jewish leaders and women disenchanted with his candidacy.

As his meeting with UAW leaders opened, Carter said labor, management and government must marshal their full efforts to get the auto industry through a period of severe readjustment..

Meanwhile, a planned Anderson whistle stop tour across the Midwest ran into a major roadblock. Originally, the trip was to begin with a noon rally in Anderson's hometown of Rockford, Ill., and then proceed by rail to nearby Madison, Wis., Lucey's home.

But it seems no one looked carefully at the rail connections between Rockford and Madison. They are awful. The roadbed apparently is so bad between the two cities that a train could not move at more than about 10 miles an hour.

So yesterday Anderson aides hastily reshuffled the travel schedule. By late in the day, the train trip through Wisconsin had been dropped. Instead, Anderson and Lucey tenatively planned to fly to Milwaukee early Saturday, then drive on to Madison and Rockford.

The trip aboard a four-car chartered train will pick up there and proceed through Illinois, Michigan, Indiana and Ohio, ending Sept. 4 in Pittsburgh.