Of course, I forgot to add that there might be challenge restrictions that only enable you to battle people in your own Class. Of course, even if Ash challenged the #7 guy right away, chances are he'll be destroyed. Even if Ash managed to beat them, I doubt Ash would suddenly jump to #7 himself.
Looking back at SS018:
Before the battle, Visquez was 2109th while Ash was basically 10000th
After the battle, Ash jumped to 3763th while we don't know how much Visquez dropped by
Based on this, Ash wouldn't jump all the way to the higher ranked trainer's ranking