Are there any references to untouchability or the presence of untouchables during the time of Ramayana or Mahabharata?
Or did the practice start afterwards?
Here's a dialogue between Bhīṣma and Yudhiṣṭhira from Anuśāsana-parva of Mahābhārata.
I shall in this connection, tell thee what the eternal usage is. In days of yore. O king, the Kshatriyas used to serve the Brahmanas. The Vaisya in a similar manner used in those days to worship the royal order, and the Sudra to worship the Vaisya. Even this is what is heard. The Brahmana was like a blazing fire. Without being able to touch him or approach his presence, the Sudra used to serve the Brahmana from a distance. It was only the Kshatriya and the Vaisya, who could serve the Brahmana by touching his person or approaching his presence.
It looks like untouchability was prevalent before the Mahābhārata time; I'm not sure if it was during the time.
There are two references to the word caṇḍāla in Vālmīki Rāmāyaṇa.
Vasiṣṭha's sons curse Triśaṅku to be reborn as a caṇḍāla because they were upset that he asked them the impossible – he wanted to reach the devaloka (heaven) with his physical body.
ऋषिपुत्रास्तु तच्छ्रुत्वा वाक्यं घोराभिसंहितम् ।।1.58.8।।
शेपु: परमसङ्कृद्धाश्चण्डालत्वं गमिष्यसि ।
Having seen his fierce intent, the saint's sons were infuriated. They cursed him saying, "Be a Chandala."
Sītā chastises Rāvaṇa saying he cannot touch her the same way a caṇḍāla cannot roam about the sanctum surroundings of a yajña.
न शक्या यज्ञमध्यस्था वेदी सृग्भाण्डमण्डिता ।
द्विजातिमन्त्रपूता च चण्डालेनावमर्दितुम् ।।3.56.18।।
The sacrificial altar adorned with ladles and vessels and sanctified by the sacred mantras recited by brahmins cannot be defiled by a chandala (man of lowest caste).
Now the Āpastamba Dharmasūtra suggests it's a sin to touch a caṇḍāla:
Thus after having undergone a long punishment in the next world, a person who has stolen (the gold of a Brāhmaṇa) or killed a (Brāhmaṇa) is born again, in case he was a Brāhmaṇa as a Cāṇḍāla, in case he was a Kṣatriya as a Paulkasa, in case he was a Vaiśya as a Vaiṇa.
In the same manner other (sinners) who have become outcasts in consequence of their sinful actions are born again, on account of (these) sins, losing their caste, in the wombs (of various animals).
As it is sinful to touch a Cāṇḍāla, (so it is also sinful) to speak to him or to look at him. The penance for these (offences will be declared).
(The penance) for touching him is to bathe, submerging the whole body; for speaking to him to speak to a Brāhmaṇa; for looking at him to look at the lights (of heaven).
So it's possible that untouchability was prevalent during Rāmāyaṇa time.