Since the basketball and the tennis ball both travel to the same direction relative to the ground, the velocity of the basketball relative to the tennis ball is therefore the difference of their velocities.
0.5 m/s - 0.25 m/s = 0.25 m/s
Thus, the basketball travel for 0.25 m/s relative to the tennis ball.