See: the Netherlands. Or Switzerland, for counterexamples.
If anything, properly built small cities and towns are actually even better for public transit, since they're small. You don't need to cover a lot of ground.
Heck, everyone talks about self-driving taxis. Self-driving trains and buses, that's where it's at, actually. A decent chunk of the cost (and limitations) for public transit is the need for human drivers. Self-driving buses could have longer routes, could drive around the clock, etc, etc.
Ah, forgot, they could also be much smaller, but still cost effective. Think 10-15 places for smaller routes. That would do wonders for connectivity in more remote places.