We did the RR and loved it, its a bit on the long side. I've heard you can take the train up and a bus back, just something else to think about. Its a beautiful ride, so anyway you do it, its well worth the time, enjoy!
A significant reason to consider the train is the history. A very worthwhile excursion in my opinion having done both the rail and driven several times. The scenery from the summit is superior from the rail. I recommend taking the pm train if your ship is in port late and get to the Park Service visitor center first. All the information there will greatly enhance your later trip via rail or car.
Why is the PM train better?? Better chance of good weather? Temp? Sunset? Our ship will be in port late that day, and there is a 4:30 train offered. Why is it better than the morning, other than the time to get the info at the Visitor's Center?
Getting to the Park Visitor center is a significant reason. It greatly enhances the train trip with the free museum, movie and walking tours (all different depending on the ranger). You may have less chance of fog going in the pm. Sunsets are not a highlight here in my experience.
Having cruised Alaska 5 times, I'd suggest you book a tour with one of the local tour companies in Skagway that will, no doubt, have folks on the pier looking for your business. There is a tour that will take you around Skagway, up the White Pass (along virtually the same path as the train, but on the other side of the ravine), and into the Yukon - it's about 3 1/2 hours long. The train tour is long, tedious, not terribly comfortable, and wears thin after a short time. The bus tour you book in town is identical to the one offered by all the cruiselines, just as reliable, but less expensive.