Yes, you can sort on a field in the Locations table by using the sortBy parameter. For example, to sort by the city field in ascending order, you can modify your query like this:
The solution proposed by Alexander works well for 1:1 relations.
However, in your case, you are dealing with 1:N relations.
As a result, the list of objects retrieved from the relation table locations is returned sorted by objectId, and this sorting cannot be changed within this query.
However, you can try using a different approach. Please take a look at this documentation: Two steps retrieval