Trains are one thing, modern chip fab is a completely different. Buying older equipment is not going to get them anywhere but into the production of chips that have been on the market for 10 years already.
This is one industry where each generation has hard limits for manufacturing.
There is a bit more history behind TSMC. You left out the bits where they partnered with other companies, like Philips, that gave them access to proprietary information. They continued building relationships with other large companies and investing back into their own business.
China isn't doing that. China has had access to older fab equipment for years but still fails to truly innovate. If US companies could trust China enough not to steal modern tech, there could be some real benefits to having fabs in China. The world kinda figured out never to send proprietary information to China years ago. Companies still do and doesn't take long for a thousand clones to pop up on Ali Express shortly after.