Getting from Cartenau to Thanalan would actually be exceptionally easy for a variety of reasons. After the battle of Cartenau, there were a great many soldiers (the Immortal Flames in particular) which would have to be heading back to Thanalan. Considering they also had to deal with a great amount of wounded soldiers (they would probably count Cid among them), it's easy to say they just brought him back with them. On a darker note, the Lichyard was notable in the Calamity for handling many of the mass graves and bodies that didn't have money for proper funerals, it's easy to assume that he might have met the priests during their work at Cartenau. And even if he did not immediately head there, he had a full five years to eventually get there.