The Soviet Union took advantage of the United States' foul problems yesterday to win, 95-94, and take the gold medal at the ninth World Basketball Championships in Cali, Colombia.

The Americans, all from the college ranks, had rallied from an 86-79 deficit with 4:30 remaining and had a chance to win at the final buzzer, but a shot by Marquette's Glenn Rivers bounced off the rim.

Rivers was his team's leading scorer with 24 points. Jon Sundvold of the University of Missouri had 16 and Mitchell Wiggins of Florida State had 14.

The Soviet Union made 31 of 44 free throws, while the U.S. was 18 of 22.

Sundvold had given the United States a 49-47 halftime lead with a shot at the buzzer. But the Soviets took the lead for good with 8:13 left in the game and U.S. hopes became slimmer when Wichita State's 6-foot-9 Antoine Carr fouled out with 5:33 remaining, forcing the U.S. to use three guards. Less than a minute later, the Soviets had their biggest lead, 86-79.

The pressing U.S. defense forced several turnovers. With 56 seconds to go, Rivers stole the ball, and Wiggins stole it again with 25 seconds left as the U.S. scored six straight points. With nine seconds left, the U.S. forced a jump ball. Wiggins tipped it to Villanova's John Pinone, who threw a long pass to Sundvold. Sundvold made a cross-court pass to Rivers, but he missed a jump shot from the side.