As taking without relative,
Since the second ball is thrown 2 seconds later than the first ball and has to meet it after 2 more seconds,
So the time taken by the first ball = 4 s and that by second ball = 2 s.
Let the distance travelled by first ball be S1 and that by second ball = S2
As S1=S2
Let the speed by which the second ball is thrown be u m/s.
Using the equation, S = ut + 1/2 * a* t²
S1 =( 5*4) + ( 1/2* 10 * 4²)
= 100 m [ Since, the ball is thrown with the gravity, acceleration will be g = 10 m/s2 approximately]
S2 = (u*t) + (1/2 *a * t²)
S2 = (u *2 ) + (1/2 * 10 * 4)
= 2u + 20
So. 2u+20 = 100
Hence, speed of second ball = u = 40
ie, 40 m/s
If considering the velocities relative ,here it is not possible,because the motion is accelerated motion hence problem solving will be too complicated