Deleting surfaces and lines
Choose
Geometry
Delete
Surface
. Select the untrimmed surfaces. Press
ESC
to conclude the process of selection.
Choose
Geometry
Delete
Line
. Select the lines defining the end of the second pipe (foreground) that are still inside the first pipe (background).