This is a better question for linguists, but "Ouch" comes from German "Autsch", which is shared with Nordic "Au/aj" and in Spanish "Ay", Latin "Ei", which since the first two are Germanic, latter are Latin, you can see the sound differences from, "Ay/Ei", which are pronounced like letters I/A, to Germanic Au/Autsch/Ouch/Ow. Which suggests a proto-Indo-European origin. It's hard for me to find in my book on Sanskrit or Avestan what the expression for pain would be, because those haven't been used as a general speaking language for over a thousand years, but if its a similar word in either of those, it would definitely point to an Indo-European origin.
According to Online Etymology Dictionary, the word "ouch" comes from Pennsylvania German (also referred as Pennsylvania Dutch), the language spoken by the descendants of late 17th- and early 18th-century immigrants to Pennsylvania, Maryland, Virginia and North Carolina from southern Germany, eastern France (Alsace and Lorraine), and Switzerland. First attested in 1837, the word "ouch" is the americanized version of the german cry of pain "autsch"
The other word, "ow", was used around 14th century as an exclamation of surprise, and then was attested in 1919 as an expression of sudden pain.
So the oldest one seems to be "ouch".