The US is not the number one in anything except military equipment. We used to be awesome. Then politics and greed ruined everything, and it is only getting worse.
Mm. Let me perhaps advance some ideas, using the education system as an example.
1) The US appeared to be great back in the 1950s: but then, what was it measuring? Was it looking at all the schools back then, or just the nice ones where the white kids were taught?
2) As an extention of this idea, the USA is a country with high inequality. The
average is dragged down by the bad ones. There is evidence to suggest that the USA has a higher than average proportion of very poor schools (almost always in very poor communities).
3) Other countries caught up. It's not hard to take a look what it going on in the world and copy what works.
So, maybe at the higher end, the USA is still a world leader. It just comes off badly on lots of metrics because of a long tail of underperformance. But that's what Americans want and voted for. You can call it "politics and greed", but in relative terms Americans have never wanted to fund welfare, education, social support and all that stuff. And so when it comes out with modest scores on all sorts of international metrics, it's really just "the American way".