Europe is a better example because it least the government must be somewhat accountable for its guns versus butter trade offs. And if you look at things like Macron trying to privatize SNCF (with its massive unsustainable debt levels), that should give us pause about the long term viability of rail even in dense places like France.
Also from a security perspective, you can't hijack a train and crash it into some building (it has to stay on the tracks), so that's a plus for trains.
Finally a domestic train causes about 41 g/km of CO2 emissions, while a domestic flight causes about 254 g/km (accounting for altitude) [0]
Note that it could be even faster without the ~50 stops in the middle.
You can fit most of China's population in a box about 1300×1100 mi, with the most distant route being about 1700 mi. In the US, the equivalent box is about 800×2500 mi, with the most distant route being about 2700 mi. (All numbers as the crow flies).
The US's geographical issue is that its major population centers--California and the Northeast--are separated by ~1200 mi of empty land, and ~700 mi of rural land. The only other countries to have that sort of major gap between population distributions are Canada, Australia, and Russia, although in each of those cases, the population distribution is more "there's one major city far away from everybody else" (that said, the Trans-Siberian Railroad cities of Omsk, Novosibirsk, and Krasnoyarsk are pretty big cities that are relatively distant, although only 2200mi at the long axis rather than the 2700mi of the US).
Nobody takes passenger trains across the continent — any continent.
California is trickier for two reasons. First, the layout of cities is somewhat unfortunate. In terms of a linear service, Sacramento, the Bay Area, LA, and San Diego are all more or less in a line, but scheduling a linear service requires detouring over the mountains twice to reach the Bay Area and boring an underwater tunnel to head north from SF. And SF being one of the two first-tier cities in CA means that you don't want to service it on a spur.
The second issue is the geography. Going from LA to the Bay Area requires crossing at least two sets of mountain ranges. River valleys don't really help you here, and the minimum viable HSR pretty much requires connecting LA to the Bay Area. This means there's strong political pressure to kill the project as too expensive before it can show any benefits whatsoever.
E.g. Shanghai - Kunming is more than 2200 km and takes between 10-12 hours[1]. At that speed LA-SF would take around 3 hours. For context the flight time is an hour and a half, so when you account for airport overhead, taxiing etc. the train would take around around the same time, and be a more pleasant mode of transport.
The density argument also goes both ways. A country like Japan is going to find it much harder to find empty space to place rail than somewhere like the US.
There's a lot of reasons for why the US isn't doing what China's doing with high-speed rail, but those reasons are mainly political, not geographical.
1. https://www.travelchinaguide.com/china-trains/shanghai-kunmi...