The site Seat61.com provides excellent coverage on the subject of How to visit Kanchanaburi.
Bangkoksite.com has a link to a “detailed train time table.”
HOW TO GET THERE
Trains leave the Bangkok Noi Railway Station daily for Kanchanaburi. The TAT office in Kanchanaburi issues an updated and current timetable for bus and rail services between Bangkok and Kanchanaburi, and major neighbouring provinces.
Travelfish offers this information:
For a more exotic approach to Kanchanaburi, you can also take the train from Bangkok. Rather than leaving from the main Hua Lamphong station, however, the two daily trains depart from across the river at the Thonburi Station. Costing 100B for a ticket, the trains depart from the Thonburi station at 07:35 and 13:45, and take just over three hours. On weekends and holidays, you can also take a special excursion train from Bangkok’s Hua Lamphong station — the tickets cost 75B, and the train departs at 06:30.
Trains also run daily from Kanchanaburi to the line’s terminus at Nam Tok. Primarily a tourist train, the trip is a spectacular run, passing by some stunning riverside scenery. The train leaves Kanchanaburi at 06:07, 10:30 and 16:30. Take a seat on the left hand side of the car (leaving from Kanchanaburi) for the best views. The train also stops at Krasae cave (alight at Tham Krasae) and Prasat Muang Singh (alight at Thakilen).