Terminal 2 to the Zócalo and back, with the timing that actually works.
Four hours sounds generous until you subtract the walk to the Terminal 2 metro entrance, the ride into the Centro Histórico, and the buffer you need to clear security again. The route below is the version that has held up: out through the metro, a straight walk down to the Zócalo, one stop at a market counter for tacos al pastor, and back the same way with time to spare.
The outbound train is the fast half. From Terminal 2 you ride in, then cover the last stretch on foot through streets that get narrower and busier as you approach the center. Weekday afternoons are the weak point. Office crowds fill the platforms and the sidewalks at the same hour, and the walk between transfer platforms is longer than it looks on a map. If your layover lands in that window, cut the food stop and keep moving.
The return is slower, and that is the part most people misjudge. The train back takes more time than the ride out, and the security line at the airport does not care about your schedule. Build the margin around the return leg, not the outbound one. A plate of tacos al pastor at a market counter is worth the detour when the clock allows it, and skippable when it does not.
What this route does not pretend to be is a full city visit. It is a timed walk with a fixed end, and the small failures are the useful part: the platform walk, the afternoon crush, the slower train home. Next time the same four hours get a tighter plan.