The magnets would then affect both planets alike.
Both planets would be affected by the magnets.