The Visitor - S4-E3
Corrected entry: Even though this episode's future is an alternate future, the ranks of both Bashir and Jadzia are incorrect according to the time. They both have the rank of Commander which is inconsistent to their age and to Nog's promotion to Captain. They should have the rank of Admiral or even retired from Starfleet.
Correction: There is no reason to assume that they would be admirals at any specific point of time. People are not promoted simply because they have gotten older. It is a combination of personal merit and the current needs of Starfleet. And so far as retirement, life expectancy is different in the future so there is no reason to believe that they would have retired at any specific age unless we are told a specific age at which starfleet officers retire in that century.
Garlonuss ★
Also as Bashir and Dax were both blue-uniformed science/medical officers, their career paths would not have taken them to command of a starship (although Dax, as well as Crusher and Troi could stand in for a while). Unless they got a transfer to the command division (as Crusher had in "All Good Things") they wouldn't get to be captains and commander would be the highest they could go.
Also, given that they are still in the blue science/medical division uniforms, the rank of Commander is probably the highest they can go without transferring away from their preferred fields and into the Command division (and we all saw how well that worked for Crusher in "All Good Things...").