Mask the edges
Position the mountains with the Move tool and transform with Cmd/ Ctrl+t to resize them, if needed. Once done, click the Add Layer Mask icon in the Layers panel. Grab the Brush tool and paint black to hide parts of the mountain layer, bending it in with the foreground.