The term "the moderns" refers to people who live in the present. Any words opposite to it?
Oxford online does indeed have a noun definition of modern in this sense:
(Usually moderns) A person who advocates or practises a departure from traditional styles or values
... although it's hardly a common term, and people would look at you odd if you referred to the moderns in everyday speech. I think most commentators would now probably use contemporary instead:
Belonging to or occurring in the present
... although it would be used as an adjective - contemporary art and not contemporaries, as the latter use implies the "at the same time as..." definition. Of course, you could also simply stick to modern as an adjective - modern people.
Anyway, that aside, the strict opposite of moderns in this sense would be ancients:
The people of ancient times, especially the Greeks and Romans of classical antiquity
... although you have synonyms such as ancestors, forebears and similar (discussion on ELU here).
In logical sense there can not be any opposite to living at present time because there are two possibilities that gives maximum ambiguity. Ancient time and future time.
An odd part about opposites in English language is the lack of such for "ambiguity". You can't say it without negation. It makes sense though consider the fact English language is the most ambiguous of all languages of a certain size. That's why it makes English so painful to learn for they who have grown up with a more reasonable language. Yes, there are many languages much harder to learn, but at least they don't hurt you mentally. Specially English phonetics vs orthography hurts a reasonable person a lot. It wouldn't hurt me if English was trashed once and for all.