Man who was train hopping, freed after being trapped for nearly 12 hours