$${\textbf{Step - 1: Find probabilities of getting a sum of 5 or 7}}{\text{.}}$$
$${\text{Let }}A{\text{ be the event that the sum of numbers rolled over dice is 5,}}$$
$${\text{The favourable cases will be (1,4),(4,1),(2,3),(3,2) and total number of cases = 6}} \times {\text{6 = 36}}$$
$${\therefore\text{ } } P(A) = \dfrac{4}{{36}} = \dfrac{1}{9}$$
$${\text{Let }}B{\text{ be the event that the sum of numbers rolle dover dice is 7,}}$$
$${\text{The favourable cases will be (1,6),(6,1),(2,5),(5,2),(4,3),(3,4) and total number of cases = 6}} \times {\text{6 = 36}}$$
$${\therefore\text{ } }P(B) = \dfrac{6}{{36}} = \dfrac{1}{6}$$
$${\text{Let }}E{\text{ be the event that the sum of the numbers rolled over dice is either 5 or 7,}}$$
$$P(E) = \dfrac{1}{9} + \dfrac{1}{6} = \dfrac{{2 + 3}}{{18}} = \dfrac{5}{{18}}$$
$${\text{So the probability of the event that the sum is neither 5 nor 7 would be,}}$$
$$P(\bar E) = 1 - \dfrac{5}{{18}} = \dfrac{{13}}{{18}}$$
$${\textbf{Step - 2: Find the probability that sum of 5 comes before 7}}{\text{.}}$$
$${\text{Let }}F{\text{ be the event that on rolling the dice sum of 5 comes before the sum of 7}}{\text{.}}$$
$$P(F) = P(A) + P(\bar E) \times P(A) + P(\bar E) \times P(\bar E) \times P(A) + .......\infty $$
$$P(F) = \dfrac{1}{9} + \dfrac{{13}}{{18}} \times \dfrac{1}{9} + \dfrac{{13}}{{18}} \times \dfrac{{13}}{{18}} \times \dfrac{1}{9} + ......\infty $$
$${\text{As we can see that it forms a }}G.P.{\text{we can find its sum,}}$$
$${\text{Sum of a }}G.P.{\text{ with first term }}a{\text{ and a common difference }}r,{\text{its sum upto }}$$
$${\text{infinite terms, can be written as}}$$
$$S = \dfrac{a}{{1 - r}}$$
$${\text{Here we have }}a = \dfrac{1}{9},r = \dfrac{{13}}{{18}}$$
$$S = \dfrac{{\dfrac{1}{9}}}{{1 - \dfrac{{13}}{{18}}}} = \dfrac{{\dfrac{1}{9}}}{{\dfrac{5}{{18}}}} = \dfrac{2}{5}.$$
$$\textbf{Hence option D is correct.}$$