You can flatten them with the Scale Elements node in Single Axis mode with Scale set to 0. By default, the pivot point for the operation is the median point of the selection, but you can choose a different vector through the Center socket:
Do note that while in this example the selection job was easy thanks to Extrude Mesh providing it, that wouldn't necessarily be the case every time—you'd have to come up with various other filtering techniques using input nodes like Index, Normal, and others... but still, it's doable.
What is not doable, yet, as far as I know, is dissolving edges. There is a Delete Geometry node, but it doesn't have a dissolving option. You could, theoretically, employ the Merge by Distance node along with some isolation and selection tricks, but in this case the best I could do was this (which is not even manifold since it can't properly merge with the rest due to lack of vertices on the long sides):