Let's calculate the gravitational potential energy of both objects by using the equation:

where
m is the mass of the object
g is the gravitational acceleration
h is the height of the object above the ground
For the soccer ball (m=2 kg), the gravitational potential energy is

While for the basketball (m=1 kg) the gravitational potential energy is

Therefore, we see that the soccer ball has larger gravitational potential energy than the basketball.