Currently, Cristiano Ronaldo is 39 and Lionel Messi is 36 mean at the time of the next soccer world cup which is going to hold in the USA in 2026 both will be respectively at the age of 41 and 38 with this age they are still doing good job and having enough games and playing so most chances we will have this mega event last for the Ronaldo and about Messi nothing is clear because he is doing good job and his body is also allowing him for having more games in future so we can expect his presence in international games for the Argentina which could be good for them and their fans as well.
It's very true both players may still be able to play for their various countries especially if been called and they are still actively playing football and nothing is wrong I'd they choose to accept of turndown the call too but then what may not be proper would be keeping high expectations on these players as they are not going to be so efficient as we would want them to be as age is now a factor playing out on them, they may even not be able to play a complete game at that time and I think they wouldn't be playing all the matchs like they did in the last world cup.
Messi literally doesn't have anything to loose if he turns out not to win the world cup again moreover he's got one to his name already so it's more like he's actually got nothing to really fight for rather than just trying to help his country at this point try to defend a trophy they just got most recently but this doesn't mean he wouldn't be giving his best, he definitely will give his best to make sure the game comes is played well.
The age difference for a player at his peak is very big... For example, how can you play on equal terms with a 20, 25 year old player? It's very difficult for veterans... As the World Cup is a short tournament, maybe with special preparation Messi and Cristiano Ronaldo will still be able to show good football.
We have history of many players those give their best at the 40+ because they have body and their game at the top and currently same going with these two both are having good performance and body is also at his best which giving them good support at this age.
I hope they can make a good showing in the next cup, of course, if they play in the tournament.
But I've seen reports from veteran players, that even though they may be in good physical shape, their body can't keep up with their thinking, so the player imagines some play or movement that their body can't execute... that's one of the reasons that they retire or begin to decline in the sport.