The Brazilian National team right now is a total mess and in little over 1 year there will be the World Cup: I really struggle to image Ancelotti accepting this type of offer while having only one year to prepare Brazil for the World Cup. If he actually manages Brazil will be after the World Cup, not before, there are just too many risks otherwise.
Actually we still don't really know what Ancelotti's plan after he leaves Real Madrid. Being a coach of Brazilian national team is just one of the options, he also can consider to retire immediately or he stops managing any team temporarily. Some coaches prefer to stop managing any team after he leaves a club. However if Ancelotti wants to join Brazilian national team after the World Cup, the management of Brazilian national team may already sign a new coach. I'm sure Brazilian national team needs him to prepare the World Cup 2026. This is the chance for Ancelotti to manage one of top national teams, he probably won't get this opportunity anymore in the future. He is 65 years old now, he may have no much times any more to continue his career. I guess Ancelotti has already considered to retire in the next few years. I'm not sure that he will be a coach/manager until 70 years old.
By the way, any decision must have its own risks. But I never doubt the ability of Ancelotti to manage any team, including managing one of the top national teams. Ancelotti knows well some of Brazilian players, some of them are Real Madrid players. So I'm a bit confidence that Ancelotti can be successful with Brazilian national team.