Build one segment tree for each chain. The segment tree for chain has size equal to the number of nodes in that chain. Position in the segment tree stores the value of the node with pos[v] = i in chain . You can query the maximum in a range in time using standard segment tree queries.
Since the tree has nodes total across all chains, the total space is for all segment trees combined. Each segment tree node stores range maximums.
Space complexity is for the data structures used.