Before my husband went home to the Lord, we traveled a lot on Amtrak in their sleeper compartments.
We discovered that the curtains on the room and door windows never seemed to meet properly. Plus, the curtains were cut too skimpy, always leaving gaps at the middle or sides, even with the Velcro closures most have. We needed privacy for changing clothes, bathing and doing his injections (due to his medical conditions) and needed a solution.
Solution: We carried a large roll of masking tape in our suitcases, and each time we needed to close curtains for privacy, we could tape them together in the middle with several strips of tape, and then also to the metal sides of the window to secure the ends. As soon as privacy was no longer needed, we would remove the tape. It never damaged the curtains or the metal, and was easier and worked better than trying to use pins, which also didn't work on the ends. One inexpensive roll of masking tape would last us even if we were on a 30-day train trip. It was lightweight, easy to pack between items in the suitcase, got smaller as we traveled and Amtrak personnel we talked with thought it was a great idea. We've even used masking tape to hold a rattling bathroom door shut at night in our compartment. It could be easily removed if the toilet was needed, and keeping a roll on the sink counter made for quick use. Now that I am traveling on my own, I don't need as large a roll of tape, but cost-wise it is a best buy. One large roll will last several trips.
Incidentally, Amtrak is proficient at using duct tape for many repairs while out on the rails. Many cars are older, and since the government doesn't give Amtrak funds needed to update these, duct tape has become a big aid. We've ridden in rooms where the sliding door between two rooms will not stay closed. Solution . . . bring on the duct tape which holds the door very securely when used all around the door frame. We frequently laughed in the past, when we would mention a problem, and someone would come into our room to fix IT, holding the standard grey roll of duct tape.