Ravana's age was more than 10,000 years when he abducted Sita. Rama was 24 years completed (say at 25th year commenced) when he left for forest and returned Ayodhya during 40th year (from Valmiki Ramayana).
Sita's age was 18 at going forest and 32 when returned to Ayodhya (from Valmiki Ramayana 3-47-10b, 11a). Sita's marriage took place when she was at 6 years old! (12 years of stay of Sita at Ayodhya after marriage, Valmiki Ramayana 5-33-17)
1) Ravana's age duringTapas:
Valmiki Ranayana, Uthara Kanda, Chapter 10, Verses 10 to 12:
दशवर्षसहस्रं तु निराहारो दशाननः ।
पूर्णे वर्षसहस्रे तु शिरश्चाग्नौ जुहाव सः ।। 7.10.10 ।।
dasavarsasahasram tu niraharo dasananah ।
purne varsasahasre tu sirascagnau juhava sah ।। 7.10.10 ।।
The ten-headed Ravana did taps 10,000 years without food. At the end of each thousand years he offered one head to Agni.
aएवं वर्षसहस्राणि नव तस्यातिचक्रमुः ।
शिरांसि नव चाप्यस्य प्रविष्टानि हुताशनम् ।। 7.10.11 ।।
evam varsasahasrani nava tasyaticakramuh ।
siramsi nava capyasya pravistani hutasanam ।। 7.10.11 ।।
This way nine heads were offered to Agni and nine thousand years had gone.
अथ वर्षसहस्रे तु दशमे दशमं शिरः ।
छेत्तुकामे दशग्रीवे प्राप्तस्तत्र पितामहः ।। 7.10.12 ।।
atha varsasahasre tu dasame dasamam sirah ।
chettukame dasagrive praptastatra pitamahah ।। 7.10.12 ।।
At the end of ten thousand years of Tapas Ravana when was about to offer his last and final head to Agni, Brahma appeared before him.
2) Lord Rama's age during Vanavas:
(i) Valmiki Ramayana, Ayodhya Kanda, Chapter (Sarga) 20, Verse 45
'dasha sapta ca varsaani tava jaatasya raaghava |
asitaani prakaankSantyaa mayaa duhkha parikSayam ||' 2-20-45
raaghava =Oh, Rama! aasitaani =sat down mayaa =by me dasha saptacha =for seventeen varshhaa Ni =years tava jaatasya =after your second birth of your thread ceremony praakaaNkshhantyaa =with hope of duHkha parikshhantyaam =disappearance of troubles
Mother Kausalya told Rama,
“Oh,Rama! I have been waiting for seventeen years after your second birth of thread ceremony, with the hope that my troubles will disappear at one time or the other.”
That means sacred thread after 7 years and plus 17 is 24 years completed and at 25th year!
Rama was at 25 years when he left for forest and returned Ayodhya at 39 years of his age.
(ii) Valmiki Ramayana, Aranya Kanda, Chapter (Sarga) 38, Verse 6b & 7a:
Maareecha narrated, the same incident of Dasarata's refusal to Vishvamitra, to King Ravana:
'uuna dvaadasha varso ayam akrita astrah ca raaghavah || 3-38-6
kaamam tu mama yat sainyam yaa saha gamisyati |'
'This boy Rama is less than twelve years in his age, unproficient in the use of weapons, and if need be, whatever army of mine (King Dasarata) is there it will march on along with me (King Dasarata) instead of Rama. [3-38-6b, 7a]
Maareecha was saying that Rama was less than twelve ( 3-38-6). Maheshvara Tiirtha said in his explanations that Maareecha lessened the age of Rama only to intimidate Ravana.
(iii) Valmiki Ramayana, Bala Kanda, Chapter (Sarga) 20, Verse 2:
King Dasharatha sais to Sage Vishvamitra,
'uuna SODASHA VARSO me raamo raajiiva lochanah |
na yuddha yogyataam asya pashyaami saha raaxasaih ||' 1-20-2
'LESS THAN SIXTEEN years of age is my lotus-eyed Rama, and I see no warring aptitude to him with the demons.'
(iv) Valmiki Ramayana, Sundara Kanda, Chapter 33, Verse 17:
"samaa dvaadasha tatra aham raaghavasya niveshane || 5-33-17
bhunjaanaa maanushaan bhogaan sarva kaama samriddhinii |"
Sita Said to Hanuman:
"I stayed in Rama's house there for twelve years, enjoying the worldly pleasures belonging to human kind and fulfilling all my desires."
Marriage was at 13 years old Rama and plus 12 years of stay of Sita at Ayodhya, means 25 years of Rama.
(iv) Valmiki Ramayana, Aranya Kanda, Chapter (Sarga) 47, Verse 10:
Sita told Ravana Kaikeyi's boons from her husband (3-47-7, 8a) and the adamant nature of Kaikeyi (3-47-8b, 9, 10a )
Sita told Ravana her age and Rama's age while leaving Ayodhya.
'mama bhartaa mahaatejaa vayasaa panca vimshakah || 3-47-10b
astaa dasha hi varhsaani mama janmani ganyate |'
"My great-resplendent husband was of twenty-five years of age at that time, and to me eighteen years are reckoned up from my birth. [3-47-10b, 11a]
The inference from the above is Sitamata's age during her abduction was in teens and Ravana's age at that time was in thousands!