Favourable cases for 5: {(1,4), (2,3)}
Favourable cases for 7: {(1,6), (2,5), (3,4)}
(I ignored the reverse cases like (4,1) for (1,4) as this happens for both 5 and 7 and hence won't affect the probability)
So, chance that total of 5 comes before 7 = 2/5
(We can ignore all other cases, as questions asks for probability of sum = 5 compared to sum = 7)