It is clear that the conditions are different, each epoch has its advantages and disadvantages. Messi in the 60s would be smaller because he had not received the medical treatment of growth, he would have suffered several injuries and play with 500 grams boots, doubly heavy balls, uneven fields, etc. However, one can compare the dominance and transcendence of each one in his time, in that aspect, it is clear that Pele has an advantage.
To answer OP's question: Its not even a discussion. Pele = 3 World Cups. Messi = 0 Pele also wasnt a scrub at the Club level either. He won the Libertadores with Santos.
It's silly to judge how great a player is/was on how many World Cups he won, Cruyff didn't win any world cups but he's still one of the best two players I saw in my lifetime, the other one was Maradona. Messi has probably been the best player over the last decade but the best player ever? Not a chance. What about all the great defenders and defensive midfielders and wingers that didn't score hundreds of goals, were they not great? This is the problem with modern punditry and statistics, it all seems to be about goals. It's turning people into simpletons.