Experimentally, I am finding that ancestors fetched using content API (/rest/api/content?expand=ancestors) do follow below mentioned order.
The first entry in the page's ancestors' array is its top-most ancestor, and the last entry is the direct parent.
But the API does not document the order of items in the ancestors' array, so I don't know whether I should rely on the order of ancestors.
Can you please confirm that ancestors order is always guaranteed to follow order I mentioned above. If yes, it would be nice if the API documentation can be updated to make that clear.