The Metro board, in a major reversal, is prepared to vote today to endorse a controversial extension of the rail system's long-delayed Green Line from Anacostia to a Prince George's County terminus near Branch Avenue, officials said yesterday.

The move is expected to clear the way for a federal judge to lift a court order that has barred construction of the Green Line through outlying sections of Southeast Washington and southern Prince George's for nearly three years.

The shift marks a key setback for advocates of another proposed Green Line route terminating near Rosecroft Raceway. In 1980, the transit authority's board of directors had backed the Rosecroft plan after dropping an earlier Branch Avenue alignment.

For the District, the revised Branch Avenue plan is expected to provide two key rail stations viewed by city officials as likely to benefit low-income areas. One of these stations, at Congress Heights, also would improve transit service to St. Elizabeths Hospital. A Southern Avenue station would help serve Greater Southeast Community Hospital.

Today's vote follows protracted negotiations between District and Prince George's officials over a multimillion-dollar issue that threatened to forestall a decision.

Some Maryland officials previously had pressed for a cheaper Branch Avenue route, along a D.C. section of Suitland Parkway. Metro's estimates indicated possible savings of $131 million, but the alternate route would not have included the Congress Heights or Southern Avenue stations.

Officials said yesterday that the dispute was resolved after the District agreed to consider splitting costs of building the Southern Avenue station, which is planned at the D.C.-Maryland line. The move would increase the District's costs and reduce Maryland's. Details were set aside for future negotiations, officials said.

In a related development, the Metro board also is expected today to consider awarding a contract to a construction group to begin excavating subway tunnels for the Green Line under the Anacostia River, an issue that recently became embroiled in a behind-the-scenes controversy.

The board previously held up action on the contract, sources said, because of allegations that a partner in the proposed construction venture had ties to a company doing business in South Africa, a volatile issue at a time of widespread protests in the United States over South Africa's policies of racial discrimination.

An investigation by Metro officials has found what was described as "an extremely remote connection" between the construction company and the South African firm, according to a source familiar with the issue. It was unclear whether the board would award the contract or continue its investigation.

Construction of the Green Line between Anacostia and southern Prince George's has been blocked since March 1982 because of an order issued by Judge Norman P. Ramsey in U.S. District Court in Baltimore. The judge held that the transit agency had failed to comply with legal requirements for conducting public hearings on its proosed routes.

The order stemmed from a court battle triggered by Metro's 1980 endorsement of the Rosecroft plan. That vote was challenged by Prince George's residents and business operators who supported the Branch Avenue alignment.

In June, Ramsey lifted some provisions of his injunction to permit Metro to start construction of a section of the Green Line between its Waterfront station in Southwest Washington and the proposed Anacostia stop. The contract for tunnels under the Anacostia River would represent the first part of this construction.

Under a court-approved agreement, the Metro board was required to decide on a Green Line route between Anacostia and southern Prince George's by this month. After the board acts, the authority plans to ask Ramsey to lift the remaining provisions of his order. Nevertheless, the southern Green Line route appears likely to face two key threats. One is a possible court challenge by Rosecroft advocates. Ellis J. Koch, a lawyer for Rosecroft supporters, could not be reached for comment.

A second obstacle is financial. No federal funds have been set aside to construct the section between Anacostia and southern Prince George's, which is expected to cost $483 million. Metro officials have said, however, that they plan to open the extension by late 1997.

A survey of board members yesterday, including Gladys W. Mack, a D.C. member scheduled to take over as board chairman next month, showed broad support for the Branch Avenue plan.

"We're supporting the Branch Avenue alignment and our board members will vote for that alignment, I presume," said John Wesley White, chief administrative officer for Prince George's. "Everything looks okay," said D.C. Deputy Mayor Thomas M. Downs.

According to sources familiar with the Metro investigation and a senior official of the construction group, the dispute over the Anacostia tunneling contract centers on Franki-Denys Inc., a minority partner in the construction team that submitted the lowest bid for the project, $25.6 million.

Franki-Denys is 50 percent-wned by another U.S. company, which in turn is 75 percent-controlled by a Belgian firm named Franki International, officials said. The Belgian firm owns a South African holding company, Frankipile South Africa Investments, which has three companies doing business there.

One of these, Frankipile South Africa Ltd., does an estimated $10 million to $20 million in construction work in South Africa. The others make drill bits and do soil analysis.