Based on the documentation, I try to sort the folders order by modified time (on the green folder).
I use Rest API V3. For my ListRequest I pass the parameters like this:
OrderBy = "folder,modifiedTime desc,name"
q = 'green-folder' in parents
This query ignores other children (red-folders), so it only organizes by the first child folders (blue-folders). What should I modify on the query?