The game tells me I've visited the subway 253 times, but I haven't yet gotten the Commuter Mug badge for riding 251 times. I don't think it's possible to visit the subway without riding it, but perhaps I'm missing something?
If you have left the game while still in the Subway Train and you re-enter the game, that increases the counter for visiting the location but not the badge. This would include dying in-game, closing the browser, flash crashing etc.
Another issue could be if you happened to enter the same instance of the Subway Train in different rides. This may sometimes occur when a group of people (generally most problematic with 3) ride the subway at the same time (especially if everyone is trying for the badge). The badge counter is only increased when you are riding in different instances, so if you are going for the badge, the best guarantee is to ride the Subway alone.
There was also a period of time when the counter for that badge was not active, so the number counted is not the same as the number of times your visited. Never fear, once the counter hits 251, you'll get the badge.
Because of what Zany said, if you're trying for these achievements, it's worth noting the "visits" count when you get a badge and remembering the difference between the two numbers. That should be consistent as your achievement level goes up (assuming you don't run into instancing issues like TomC mentioned).
So for instance, I got Subwayfarer (23 visits) on my 25th visit, so I expect to get Ground Hogger (103 visits) on my 105th visit.
My gut feel (and it would be interesting to try checking this out) is that train instances continue on in the same direction. So if three of you rode the subway together, all jumped off at the same station & jumped back on in the opposite direction, I think that would safely count as a second trip. Be good to hear if anyone's proved that though :-)