Remember they have to do something in the 32nd century, not just sightseeing (though it wouldn’t be so bad). So I’m guessing the Federation IS in-fact destroyed, but they take it upon themselves to figure out how/when it got destroyed and “fix” it.Why NOT?
Besides, we know the Federation survives into the 29th century ("Relativity") so another hundred years or so would not be that big of a stretch.