A boy who raped a young girl when he was aged 12 has been jailed a decade later.