The return from Kanchanaburi leaves at 14:44. But if you can't make that, there are also buses to Bangkok until at least 18:00. One nice advantage to taking the bus back is that it will let you off near Pinklao Bridge, before swinging back all the way out to the Southern Bus Terminal, which is halfway to Nakhorn Pathom.
I usually take the train there, and return by bus. But I also don't do it all in a single day. (When I go, I like to ride a motorbike around that beautiful province, at least for a day or two.)
If you are trying to do this whole trip in one day, it might be better to rent a van/driver in Bangkok - because you could waste some time to rent transportation in Kanchanaburi, and then you'd also need to get a couple of taxis once back in Thonburi, to find your way back to this side of the river and your hotel. With seven people, the van would be cheap.
Unless, of course, you really do want to take that lovely train. No doubt it has the same coaches that you missed 35 years ago, which I guess was the whole point of my earlier post. These days, people can be in such a hurry to get somewhere that we can forget that the trip, is a very important part of the trip.
Oh, for what it's worth (perhaps nothing at all), I'm pleased to note that I have just won over a new Thai convert to the old train. My friend who has lived in Kanchanaburi province her whole life, recently moved to Baan Phong in Ratchaburi province, where she dropped me off at the station awhile back, when I was visiting. She was absolutely astonished that the fare to Bangkok was just 18 baht. Said she had never even considered the train before, even though she came to Bangkok often over the years, and is of meager financial resources. Today, she told me that she got a new job in Ratchaburi town, and is now taking the train there and back, every day - costing 24 baht for the roundtrip.