I wonder if US still manages to keep the most promising?

Yes, but today less so than yesterday? We also are benefiting less from the top students with state funded undergraduate education in China and India.

On top of that, it is a significant reverse brain drain. Like 20-25 years ago you'd be hard pressed to find tenure track CS faculty at most America programs let alone a major program lime Cal or UIUC consider returning to a program like Shanghai Jiao Tong or IIT Bombay compared to today.

It has upskilled academia in those countries, but we also lost talent who could have remained here.

It is it really our talent though? The US has been so addicted to China and India for STEM talent for so long that...what did they expect was going to happen? And the effect is much more prominent for China than India: China has a lot of money to dump into modernizing while India is still a relatively poor country. Imagine what will happen when India gets richer as well?

Based on personal experience (friends who either entered academia/industry or me being the son of white collar immigrants to the US) I'd say large portion want to return to China and India due to family ties, but a number would have stayed in the US if immigration wasn't such a PITA - especially because companies and programs don't really like filing for an O-1s unless they found a unicorn.

You hit the nail on the head on developing countries not being as poor anymore, and opportunties proliferating which reduces the pull factor, but there are a decent amount of academics and professionals who would gladly work in the US if given the opportunity and it wasn't such a headache.