How to make an object automatically take the same height as another object?
Maybe the Shrinkwrap Modifier can help you out. (I think i unlikely but i though I'd propose the idea anyway, just in case.)


Both cities have to be one object each though (Separate &gt; By Loose Parts could be done later)

And in this example (Mode: Project, On Surface) the blocks with the right height slightly overlap the map blocks so the map blocks vertices have a surface right above them to snap on to.


Edit:
I suspected the top faced wouldn't turn out flat. But you can use LoopTools to fix that if needed.
Go to Blender Preferences &gt; Add-ons. Search for &quot;looptools&quot;, and check the box next to Mesh:LoopTools.
Go to the 3D Viewport and in a sideview (Numpad 1 or 3) you should be able to easily select all the top faces of the buildings (select the top vertices in Vertex Select and then switch to Face Select is best i think).
With all the top faces selected, press N to open the 3D Viewport Sidebar Panel (if it isn't op en already) and click the Edit tab. Extent the LoopTools menu. Extent the menu under the Flatten button. Choose Plane:View. Press Numpad 7 to go to topview and press the Flatten button.
All the faces should now be flattened while still being at their own respective heights.