@rajesh_balasubramanian Hello. I was just looking for an online CAT coaching and stumbled upon this. The answer seems to be 7. And i don't think 10 can be a value for B. Eg: Take the Track length as 300m. A will complete it in 50secs. And B will take 75 secs to overlap A for the first time(300/4). I can email you my solution if you'd like to give it a look.
Thank you.

a^2 + ab + b^2 = n^2(a+b)^2 = n^2 + ab(a+b+n)(a+b-n) = ab
as 'a' and 'b' are prime numbersab has 4 factors: 1, a, b, abobviously, a + b + n > a + b - n
Case 1:a + b + n = aba + b - n = 1
Case 2:a + b + n = aa + b - n = b ... considering a>b
But, case 2 is not possible.b = -na = n,a = -b ... which is impossible
Case 1:adding the two equations2a + 2b = ab + 12a - ab + 2b = 1a(2-b) - 2(2-b) = -3(a-2)(b-2) = 3
only possibility for 'a' and 'b' being prime and satisfying the above condition is: 5 and 3
giving us he only possibility 49