Explanation:
d = the distance in one direction.
the time t1 it took group 1 was
t1 = d/6 + d/4
and t2 for group 2 moving with speed2 all the way
t2 = (d+d)/speed2
we know
2d = 24 miles
d = 12 miles
t1 = t2
so,
12/6 + 12/4 = 24/speed2
2 + 3 = 24/speed2
5 = 24/ speed2
5×speed2 = 24
speed2 = 24/5 = 4.8 mph
the second group moved with 4.8 mph.