I doubt there are a lot of places where you're replacing that scenario with public transit.
I think my last commuter rail is around 10:30pm but I'd have little confidence that I could get a taxi/Uber from the train station; it's not that far but certainly not safely walkable especially late at night.
Picking some random village I've never been to, from Copenhagen to Uggeløse (population around 2000) takes 65 minutes, the last connection to the bus requires leaving Copenhagen at 23:16.
Picking some other village that's on a railway line (Veksø, population 1800), the trains run all night every 30 minutes on Friday and Saturday nights. On other days the last train is at 00:30-ish.
The original claim was from a city to a town, which is easier than either of these examples.