There are no train connections to Dubrovnik. The closest rail station is at City of Ploče. If you plan to travel by rail you may choose to arrive to Zagreb, Split or Ploče and take a bus (from Zagreb, Split or Ploče), plane (from Zagreb) or boat/ferry (from Split) to Dubrovnik.
Train timetable is available bellow: TRANSLATION OF TERMS:
Polazni kolodvor /Departure station; Odredišni kolodvor / Arrival station; Vrijeme polacka / Time od departure