PyUtils: Improve diff-root re-syncing for multi-dimensional data
This is a follow-up to !45229 (merged). Here, we improve the re-syncing logic to better handle multi-dimensional data. Instead of building a pseudo-index for elements, we now build a list of actual indices and use python's built-in comparison that uses lexicographical ordering.