Take into account that earnings for accounts A and B can be written as follow:
account A:
500 + 60t
account B:
500(1 + 0.06)^t = 500(1.06)^t
Now, if you replace for different values of t, in order to compare the earnings for each account, you can determine what is the value of t which makes earnings from account A greater than earnings from account B.
For instance, if you use t=22 and t=23
500 + 60(22) = 1820
500(1.06)^22 = 1801.76
500 + 60(23) = 1880
500(1.06)^23 = 1909.87
As you can notice, after t = 23 years the earnings from account B are greater than earnings from account B.