This almost feels like a question for https://english.stackexchange.com/, but since it's asking about Star Trek specifically...
The answer is still exactly the same - it relates to the definition of the phrase.
- the study or a course of study of history before the end of the Western Roman Empire a.d. 476.
- information or an event of the recent past that is common knowledge or is no longer pertinent: Last week's news is ancient history.
- an event, as in a person's life, that occurred in the remote past and has no practical relationship with the present: She was my best friend in high school, but that's ancient history now.
Or from the Free Online Dictionary's Definition of Idioms:
Fig. someone or something from so long ago as to be completely forgotten or no longer important, as a former relationship.
In other words, there is a literal definition for a period of time that covers "Ancient History", but there are other definitions - usually referring to a time or an event that has no relevance today.
That being said, only a well-studied Historian or an English professor would call Commander Riker on the use of the phrase to describe something that happened several hundred years ago. Just as someone today would be considered very persnickety to complain about someone referring to Shakespeare's Plays as part of "Ancient History", even though technically it's part of Classical History (then again, I'm neither a historian nor an english professor, so it may be some other period of time altogether).
My point being, it's a phrase that has a very specific meaning, even today, that often enough gets used to mean something that it does not include, that I doubt that would change by the 24th century. (Again, not an english professor)