BANGKOK, JAN. 20 -- Vietnam has agreed in principle to an airlift of 30,000 Amerasian children and their relatives from Vietnam to the United States in the next two years, two U.S. congressmen announced here today.

Rep. Robert Mrazek (D-N.Y.) and Rep. Thomas Ridge (R-Pa.) returned to Bangkok following a three-day visit to Vietnam during which they sought Hanoi's cooperation in allowing all Vietnamese-American children fathered by U.S. troops during the Vietnam war who wish to leave to do so within the next two years.

The United States already has resettled about 4,000 Amerasians under a separate program administered by the United Nations.

In January 1986, Hanoi, complaining that American red tape had caused delays and a large backlog of applicants, stopped interviewing Amerasians and other Vietnamese seeking to migrate to the United States.

Vietnam agreed to resume its cooperation last August after presidential envoy retired general John W. Vessey Jr. said the United States would implement changes, including a more streamlined, bilateral approach. The first group of Amerasians to leave under the bilateral agreement arrived in Bangkok on Dec. 31.

{In Washington, the State Department said today it was "delighted that the Vietnamese have reconfirmed their interest in continuing the existing program."}

Legislation sponsored by Mrazek, and signed last month by President Reagan, created a new immigration category for Amerasians, who had been leaving Vietnam as refugees.

The legislation also appropriated $5 million for fiscal year 1988 to move Amerasians and their families from Vietnam to the Philippines for six months of cultural training before resettling in the United States.

Mrazek said today that he and Ridge met with Deputy Premier Nguyen Co Thach, who "pledged the full commitment of Vietnam to the two-year deadline and indicated he hoped the program could be completed in one year."

The congressmen estimated that about 30,000 people -- 8,000 to 12,000 Amerasians, whose average age is 17 1/2 years, and their family members -- would leave under the program.

Mrazek said Vietnam already has begun a survey to find the Amerasian children in each of the country's 40 provinces and has started setting up a processing center for Amerasians and their family members about six miles from Ho Chi Minh City, formerly Saigon.

Thach agreed to give first priority to Amerasian children living on the streets of Ho Chi Minh City, Mrazek said. In the past these children apparently were not eligible to migrate because they had no fixed addresses.

Bruce Beardsley, director of the U.S. Orderly Departure Program office in Bangkok, is scheduled to visit Vietnam on Feb. 4 to negotiate details for the airlift of the Amerasians, U.S. Embassy officials in Bangkok said.

Ridge, a Vietnam war veteran, said many of the Amerasian children they met during their visit to Ho Chi Minh City face very difficult lives. "There's no official discrimination," Mrazek said, "but they are ostracized by some people whom they remind of the war."

The congressmen also noted that some of the Amerasians they met were bitter and angry because they were locked out of the economic and educational opportunities available to other Vietnamese.

Mrazek estimated that about 1,200 people would have to come out each month to meet the two-year deadline. He said the current monthly average is about 200 Amerasians.

According to the congressmen, about 7,000 American families have registered to sponsor the children. They also said that fathers who can be traced will be contacted and offered a chance to take in their offspring.