Star Trek: Enterprise, which was set 100 years before Star Trek: The Original Series, had a female captain.
In the Star Trek: The Original Series third season episode, "Turnabout Intruder," Dr. Janice Lester, a former love interest of Captain James T. Kirk, uses an alien device to switch bodies with him. Lester is bitter because she has not become a captain and blames Starfleet and sexism. In The Original Series, there were no female captains, and that had a lot to do with the time period (1960s) of that show.
However, long before the Enterprise warped through space under Kirk's command, a female captain, played by Ada Maris, captained the second Starfleet starship in the fleet, the Columbia. Like Lester, Captain Erika was a former love interest of the captain of the Enterprise. And sexism clearly didn't play a part in keeping her from taking to the skies and from helping Captain Archer in three episodes of season four of the series
Did Star Trek: Enterprise writers consider Turnabout Intruder when writing season four?
Probably not as the writers of Star Trek: The Next Generation didn't consider how the Klingons were originally portrayed in The Original Series, either. However, this was about more than how a person/alien looked. This was a woman blaming an entire organization for her failure to climb the ladder, so to speak.
So since her career floundered, should we then assume that her mental instability kept her from advancing the ranks in Starfleet? Or was her lack of a ship to command and the belief of sexism responsible for her mental breakdown?
The Star Trek franchise isn't the best at keeping timelines and canon intact. But there was no way the writers of The Original Series could have ever known that fifty-plus years down the road the franchise would still be going strong. So some things, we just have to overlook or pretend they didn't happen.