Mars' moon Phobos has a mass of 1.07x1016 kg and a mean radius

of 11.1 km. Let's say our rocket blasts off from the surface of Phobos
when Phobos is 9500 km from the surface of Mars. Does the rocket have
to work harder to escape from the gravitational pull of Phobos or that of
Mars?

1 answer

The energy per unit mass required to escape the gravitational pull is
G M/R
where M is the mass of the planet or moon that is being escaped, and R is the radius (measured from the center) where the launch process starts. Compare the M/R values for Phobos and Mars. You will have to look up the mass of Mars and add the radius of Mars to 9500 km to get the R value for Mars. G is the universal gravity constant, which is the same for both.