After surviving several hectic moments during 24 hours of confusion and indecisiveness, the United States water polo team captured the gold medal in the Pan American Games today by edging Cuba, 8-6.

The U.S. team never trailed during the battle of unbeatens, but it could not seem to shake the Cubans, either on the scoreboard or in the wrestling matches that took place in the water.

After squandering leads of 3-1 and 5-3, the United States went ahead to stay at 6-5 on Gary Figueroa's third goal of the game.

Jon Svendsen made it 7-5 while the United States had a man advantage, but the Cubans made one more surge as heavy rain pelted the pool. Pablo Roger netted his third goal of the second half with 2:41 left and it took a big save by goalie Craig Wilson on Carlos Benitez, with the United States short-handed, to maintain the lead.

Cuba's hopes ended when Jesus Derouville was sent off with 36 seconds remaining. The United States succeeded in playing keepaway until Terry Schroeder launched an unstoppable shot to conclude the scoring with 12 seconds on the clock.

"Cuba is a very good team and a traditional rival for a lot of different reasons," Figueroa said.

"It was a very physical game, but it was a lot of fun playing them," said Figueroa. "Sure, drinking water is fun."

Figueroa scored five goals when the United States beat Cuba for the gold in 1979. Then, following the 1980 Olympic boycott, he retired. He came back three months ago.

"It's a pleasure to me to see Gary Figueroa play so well," said U.S. Coach Monte Nitzkowski. "Defensively, he's not ready to play, but he got us the goals. Give us 12 months with him and he will really give us a lift."

Beating Cuba was not necessarily the hardest thing the United States accomplished in water polo in the last 24 hours. More amazing was the way it survived a series of mishaps to beat Mexico, 14-3, on Sunday in a match that began 8 3/4 hours late.

The United States and Mexico were scheduled for an 11:15 start Sunday morning, at which time the U.S. players were sitting in a broken-down bus on a highway far from the Piscinas La Rinconada.

Complicating the problem was the fact that they expected to play at 12:30, because it was using a preliminary schedule adopted by FINA, the international federation overseeing the the competition, but later changed by the organizing committee.

The Mexicans, who still had a shot at the bronze medal, demanded a forfeit. When they were ordered instead to play at 12:30, they angrily departed and returned to the Pan American village.

"We warmed up and got out of the pool and they wanted us to warm up again," said Mexican Coach Eugenio Almeneiro through an interpreter. "Instead, we went to the village. All teams had the same schedule except the United States. It is impossible . . . to have two schedules at the same time.

"We felt if Mexico had been late, we would have been forfeited to the United States. We agreed to abide by the ruling of the delegates' meeting, but that was at 3 and they wanted us to play at 12."

The meeting overruled the forfeit that had been officially declared and the game was ordered played at 8.