What's the best place to visit within 5hr train ride from Chiang Mai?

I rode the sleeper train from BKK to Chiang Mai last year. It was my first time to be in a slow train (as opposed to fast trains in China and Japan that of course we use to only get us from point A to point b), and I enjoyed the total experience, including going down the stations that we stopped in the early morning (as locals of course are going to their hometowns) to take quick pictures.

Going again to CM (direct flight this time) with a friend next month. I wanna experience using the train system again--the station, sway, and all--but this time staying a night or two on another town--but not as far as all the way to BKK, maybe within 5hr max train ride of CM.

Which is the best, most interesting train-reachable town that you recommend? We're both males--wholesome (hikes, plantation, unique food) to 'non-wholesome' (bars, red light district) vibe in that town as aspect/s that make the place enjoyable are all for consideration. Thanks!