Certainly they did. Livy, an ancient roman historian, describes people in the past as 'ancients' and Tacitus describes his time as 'modern' in Agricola.
While some groups of people may have thought of themselves as "modern" in relationship to older societies, the way we have (and perhaps still do) conceive of "modernity" is not exactly analogous to these prior concepts of modernity.
"Modernity" as Western society has characterized it is largely a product of Enlightenment thinking in the 18th century, fully realized at the end of the 19th and early 20th centuries. This idea of modernity is a structured rationalization of society by which I mean the reorganization of society into a rational or scientific structure meant to improve society. Modernity then is conceived of as being a conscious attempt at improving society through these specific methods, compared with the irrational or happenstance organization of pre-modern society. The key byword here is "progress" and the notion of scientific and social progress.
Importantly, there is a connection here to the growth of governments and states as organizing factors in society in comparison with other social institutions, such as religion. The idea of European modernity in the last few centuries is that pre-modern societies relied on these other social institutions (like religion or kinship) to organize society where the modern society organized itself through the intervention of rational government.
To quote James C. Scott from Seeing Like a State (emphasis mine), who summarizes much better than I ever could:
...[high-modernist ideology] is best conceived as a strong, one might even say muscle-bound, version of the self-confidence about scientific and technical progress, the expansion of production, the growing satisfaction of human needs, the mastery of nature (including human nature), and, above all, the rational design of social order commensurate with the scientific understanding of natural laws. It originated, of course, in the West, as a by-product of unprecedented progress in science and industry.
High modernism must not be confused with scientific practice. It was fundamentally, as the term "ideology" implies, a faith that borrowed, as it were, the legitimacy of science and technology. It was, accordingly, uncritical, unskeptical, and thus unscientifically optimistic about the possibilities for the comprehensive planning of human settlement and production. (pg. 4)
In other words, while other societies may have viewed themselves as "modern" (or the linguistic equivalent), what they thought "modern" meant might not be exactly the same as a contemporary idea about modernity.
Edit: For formatting and errors.
Source: Scott, James C. 1998 Seeing Like a State: How Certain Schemes to Improve the Human Condition Have Failed. Yale University Press.