If we take his age as 25 years while leaving then it contradicts other with the age of Bal Kanda because then he would be below 13 and not just below 16 as mentioned in Bal Kanda Hence the shloka of Aryana Kanda where the age of Sri Ram is said as 25 years while leaving is later interpolation.
So 17 years mentioned there while leaving Ayodhya is actually the years passed after his thread ceremony. This thread ceremony is called Second birth and is referenced in many many scripts across time. Here we have a clear contradiction in ages, this can be resolved simply, the age of Dvijas is calculated from the time of their thread ceremony too, this was common sense to people of that time and in any learned families of Vedic background.