Let p be the probability that student A wins. We consider the possible outcomes of the first two rolls. (Recall that each roll consists of the throw of two dice.) Consider the following mutually exclusive cases, which encompass all possibilities.
Note that in the last two cases we are effectively back at square one; hence the probability that A subsequently wins is p.
Probability p is the weighted mean of all of the above possibilities.
Hence p = 1/36 + 1/216 + (29/216)p + (29/36)p.
Therefore p = 7/13.
Source: Extra Stuff: Gambling Ramblings, by Peter Griffin. See Chapter 6.