Fred is 30, hardly on his last legs.
Brazilian forwards have had a tendency to fade earlier than European counterparts.
He's never had blistering pace to begin with and another year older since confederations cup won't have helped but that isn't his style of play, he is fast when he needs to be. He is more of a target man than someone who likes to run about a lot so it doesn't show but he does use his pace at times and I hope he still has it in him for the next 4 years so Brazil have a chance to find someone else in the mean time.
But I doubt he has more than another couple of years left in him at international level tbh so that would deem he is on his last legs.
The main point is Costa should be Brazil's first choice striker and Fred should be second choice, that's if Costa can apologise (he won't though as he's far too arrogant and filled with rage) and the fans and coaching staff accept him or even want him back after turning his back on them.
Put it this way if Brazil get hit with a couple of injuries they are now screwed and they are hosting the world cup and the people expect them to do well.
For a player to have been born in Brazil where football is a major passion, and to then turn his back on his country where most would kill to be in his shoes I think was the last nail in the coffin which holds his international career.
Anyway he will most likely never play international football for Brazil again unless he apologises publicly on national tv or something, and a very very slim chance he will ever represent spain either because he has played for Brazil.
So imo he won't ever get a change of nationality in fifa because he is Brazilian and has played for them at full international level twice.