Quote fromThis seems to be a common glitch, but the taking no damage thing is new. Haven't read about that before.
Hm... At the moment my guess is it's some sort of random catastrophic glitch in the "riding animal/cart" code, because being stuck in midair was a glitch caused by that earlier.
I'm pretty sure there's a way down from there, but I forget what it is. Have you tried quitting and then loading your save?
I wasen't in a minecart, but I did place on on the rails I was placing down got in it and got bakc out to see if it fixed it and it didn't.