Experimentally, I am finding that for comments, the first item in the ancestors array in the response is the direct parent, but for pages, the last item in the ancestors array is the direct parent.
The API does not document the order of items in the ancestors array, so I don't know whether I am supposed to be able to rely on the order of ancestors at all. It would be nice if the API documentation can be updated to made that clear.
Of course, if the ancestors array is currently not in any guaranteed order, it would be nice if that could be changed so that the order is meaningful and is the same for all object types.