When you say you execute it via XOG, you mean to say you are calling the NSQL WSDL Query to get results out as XML, but the records in the resulting XML are sorted by T.res_id?
If so, you can provide sorting options dynamically (i.e. not hard coded in the query) by ensuring it has a where @FILTER@ section and then placing the correct section into your query read request:
<quer:Query>
<quer:Code>replace_with_your_query_code</quer:Code>
<quer:Sort>
<quer:Column>
<quer:Name>team_lider</quer:Name>
<quer:Direction>asc</quer:Direction>
</quer:Column>
</quer:Sort>
</quer:Query>
You can use the community/free edition of SoapUI to help generate and test a query request with different parameters to see if you can get the results in the order you seek.
If I've misunderstood, please provide more details for the challenge you are facing.