This is a phrase that actually means "To go as fast
as possible" or "to push the limit
s". Very similar to "pedal to the metal
". In fact, the origin of this prase apears to be a duplicate of that well known phrase.
In old trains (the mechanism is probably different in newer trains), the governor had two arms with metal ball weights. When the engine was "balls to the wall" (the weights extended fully), the engine was at the maximum speed that the governor would allow.