Rip the pipe out. Failing that, dig the pipe out with your bare hands. Either way, you can then turn the pipe upsidedown and shake the ball out.
EDIT: Or, do a handstand, so you're holding the Earth up, that way the inverted gravity will make the ball fall out.