Typically modern phones and modern base stations rely upon significant improvements in radio technology since the early 1G/2G years. Also the density of base stations has increased somewhat too, plus the way base station handover is managed, signal strength, optimisation (MIMO antennas) etc.
Now it is possible that your phone is connecting to the car's Wifi, which is then routed over a (most likely 4G) or 5G connecting - at least my Passat can do this, but VW's Infotainment system software is just really really bad, so I let the phone work on its own connection. Also, I think VW charge for this service, and it isn't cheap.
If you're on a train then there are quite a few options (also applies to home, car etc) - on-train Wifi will aggregate everything and route it over 4G/5G (even satellite is possible), you can do the same with a base station (eNB, gNB in 4G or 5G parlance) and aggregate from there, or just let your phone connect to the nearest/most suitable base station. One issue with the local base stations (eg: one in each carriage) is that they'll be provisioned on a per-operator basis, and you get into roaming agreements etc, so some phones will be rejected because they're using the wrong operator. Another option is that the train company sets itself up as a private operator and routes calls from there to the public operators. Not particularly hard to do, but maintenance is a problem and antennas and the rest of the base station equipment isn't cheap. The issue with these ways is still of course getting sufficient bandwidth (and signal reliability) from the train to the rest of the telecoms network, which requires good cell coverage.