They were like 16 when that happened and they don't necessarily need to have the same height...
(+ we don't know if it's was the same "Tobi" all the time >.>
he had a growth spurt lol different people are different hights and it was years after obito supposedly died after the 3rd war so he would have grown some