Take them without fear!
I had my son with me when we did night trains, but still not an issue (he was 17).
We did a mixed compartment on our first night-train trip and shared it with two young women (looked like they were traveling together, but if they spoke English, they didn't let on). That one was Rodez to Paris.
We also did "somewhere" (Vienna? Can't remember) to Krakow, Krakow to Prague, I think Prague to Nuremberg, and Nuremberg to Amsterdam. The Krakow to Prague train was cheap enough that I splurged to get us each our own single compartment. The others were two-bed compartments with just the two of us.
Some trains do sleep better than others, but that mostly came down to the timing of the stops and if they were moving cars around. Don't expect to show up in a new place completely refreshed and rested, but you should be fine to explore until you can check into your next room.
Just this spring, I did an overnight ferry from Stockholm to Turku. I saved money by doing a female-only shared room (up to 4 women). The first night I shared the room with a lady in her 70s, headed home to see her family. She was an absolute delight. On the way back, I lucked out and scored a room all to myself, so was able to take a shower in the morning and do everything without disturbing anyone. I know that's not a train, but that's the "completely solo" experience I've had in an overnight transportation vessel.
I hope you have an amazing time!