There are a couple of factors that play into the answer of this one, so there's not a very simple answer. Firstly, photorealism is definitely the invention of an era in which photography exists. Even some of the most incredibly realistic art in history isn't quite photorealistic because that standard had not been set yet, the idea probably hadn't been considered. Artists could achieve realism to the best of their ability, and then had license to make it look more impressive or aesthetically pleasing.
Beyond this, there is certainly something to be said about the way style evolves in history. Questioning art, what is good art, what is bad art, and appraising art based on ideals instead of aesthetics is incredibly new to art history. The artists of the past did not question art or develop dramatically new techniques (with exception of some artists!) because this would challenge the status quo of art. Firstly, art was for the rich, and to create something that challenged the current art style was the death of your career because rich patrons would not hire you. Secondly, if you were an artist then you learned from a master and created art that 100% matched their style until you became a successful artist and got the opportunity to change a few things. If you didn't adopt the exact style of your master, you were fired as an apprentice. The Egyptians kept the same art style for several hundred years! That's how powerful tradition can be.
Next we have to question the materials available at the time. Paints and other materials were made in a very different way and behaved very differently during those times. Realism is certainly achievable with the materials they had, but the finer detail of photorealism might not have been achievable.
There's also the question of what the patron wanted out of the art piece. Most patrons were looking for something beautiful, and depending on the time and place that definitely meant not rendering every detail. The Romans can be excluded from this, they had a fun thing for very realistic portraits and busts and were some of the first art consumers to actually request to be depicted with every single wrinkle.
There's much more to be discussed about this, but those are some basics surrounding the conversation!