I would not say S2 solves this problem. Two close points may still have totally different cell ids in S2 too. One can argue S2's Hilbert curve makes it somewhat less common than with Z-curve used by GeoHash, but the root problem remains.
When you use S2 you don't normally use prefix comparison though, you use interval search. Alternatively, you compute a few prefixes possible within a specific radius of a point and search for them. You can do both of these approaches with GeoHash too of course.
S2 solves a different problem with GeoHash, which makes it impractical to use GeoHash for nearby search except in local cases: very different size and geometry of the cells. The GeoHash cells near the poles are much smaller (in real area) than the cells of same level near the equator. Near-polar GeoHash cells are also stretched. S2 cells are more even across the globe.