There are two scheduled boat services that connect Rum with the mainland:
If not travelling to Mallaig or Arisaig by car, you can reach the ferries by scheduled ScotRail train service (although note that the pier at Arisaig is not as close to the railway as the pier at Mallaig).
The famous ScotRail 'Deerstalker' Caledonian Sleeper provides first class (single cabin) and standard class (double cabin) sleeper and reclining seat travel between Fort William and London Euston every night except Saturday. Local trains connect to Mallaig.
If travelling by day train, travelling to Rum from anywhere further south than Fort William is only possible without an overnight stop in Mallaig on summer Saturdays, when the early morning train from Glasgow Queen Street station connects with the second CalMac sailing to Rum.
Travelling from Rum to points beyond Fort William by day train is likewise only possible on summer Saturdays, when the first CalMac sailing from Rum connects with the train to Fort William and Glasgow Queen Street.