It has been many years since I crawled around under a railroad car so any new developments in design or configuration are unknown. Back in the day there was clearance under your standard freight car. You might get hit with a low hanging air hose though. An unknown in the world of standard (not subway designs) is what the clearance under the locomotive itself is. I probably could get this info next time I can catch up with an acquaintance who works in train service for one of the major carriers - but due to our differing schedules, I don't see him that often.
Subway cars nether regions I am not familiar with, so maybe if there are any NYCT people out there we can get a better answer. I do know that on the NYCT system, the 'trench' between the main rails can be seen at most every station by looking at the tracks - just make sure there are no nutcases in a pushing mood when you look!
Like I said, I wouldn't want to test the clearance with my body. Maybe we have a volunteer..
I’m guessing about 14 inches, with the main limitation being from the traction motors. Otherwise, it would be at least 20 inches.