The coordinates of the houses of A and B are (7, 3) and (4, -3)

whereas the coordinates of their school is (2, 2). If both leaves their houses at
the same time in the morning and also reaches school on time then who travel
faster?

figure the distances

from (7,3) to (2,2)
from (4,-3) to (2,2)

The person who traveled farther traveled faster, since speed = distance/time, and the time was the same.