collect_descendant_indices(node_id, children_map, leaf_batches)
Recursively collect all item indices under a node.