They’re actually hovering over a fixed point of the planet, which means that the bombs would fall down towards the nearest source of gravity. Everything falls in space.
Or the bombs could have been magnetically impelled down the rails.
Or the topmost bomb in each line could have been pushed mechanically to move the entire line.
Or they could have been drawn to the more massive Dreadnought.
Or they could have been self-propelled like Maul’s probe droids from Episode 1.
There’s five potential explanations with a minute of thought.