Sort by weight using \Drupal::entityQuery()
Taxonomy overview list uses something like:

  -&gt;sort('weight', 'ASC')
  -&gt;sort('name', 'ASC')


If that doesn't work for you, take a look at \Drupal\taxonomy\TermStorage::loadTree