I'm no physicist, but I don't think you can do that. If an object is moving at a constant speed, it has no net force acting on it. Force is defined by acceleration and mass.
However, you can tell if the phone is still moving. If you see a rise in acceleration followed by a drop to zero, it's still moving. When the phone stops moving, you'll get an acceleration in the opposite direction equal to the starting acceleration.
So, if you move your ball up when you see an acceleration in that direction, don't just move it up by the current value. Sum the accelerations you've seen so far(weighted by time between sensor readings?). That way when it drops to zero, it will stay put. When it starts to accelerate the other way (slowing down), it will subtract from the position until it's roughly centered again.
Of course, the accelerometer is prone to drift, etc, so it's hard to get this perfect.