before I get into my question I wanted to thank everyone for their input in my first thread about the general principles of river drawing. I have taken your comments under consideration and began redrawing my waterways accordingly. In the meantime, I'd like to ask a question about rivers and their relationship to mountains.

I've been working on a small, narrow gauge logging railway in a mountaineous region of my land, that runs, for the most part, in a picturesque river valley. Here is something that I've been workshopping and I've been wondering if it is at all prototypical - can a river that was in a relatively flatter part of the land later run between two (or more) large peaks?

<img src="https://i.sstatic.net/w5Cnk.png" width="300" height="222">

I know the reverse can happen, where two imposing peaks on either side can give way to flatter land, but I'm wondering whether what's on my map is at all true to life, given that most major river basins, from what I've seen, tend to get flatter the closer they are to their mouths. Are there any mitigating factors that could make something like this happen in real life?

The use that I would have for an opening like this would be to run the railway through it alongside the river. The trouble is that I haven't seen many examples of something like this in real life except for the confluence of the Hron and Slatina rivers in Slovakia - the Hron ran in a relatively wide valley north of Zvolen, and then squeezes in between two peaks when it meets the Slatina in Zvolen. Because this happens in an industrialized part of the city (Zvolen), I have no idea whether this course was in any way affected by man made activity.

<img src="https://i.sstatic.net/GReGz.png" width="300" height="149">

Of course, if I had to implement a ridge bridging these two mountains together, I could run the railway through a tunnel, but that would be an expensive engineering venture for a frugally built logging railway, and they probably wouldn't have bothered. I do have some alternative routes, but I'd like to get some clarification before fully committing to anything. Thank you!