You can't get a train from S'pore to Melaka at present - there's been repeated talk of building a new branch line from Tampin, but it's not happened. From Singapore you can get the Singapore-Malacca Express. It's something of an institution and does what it says on the tin, and is a hourly express shuttle service. Last bus is fairly early though, about 7pm, so plan accordingly.
Journey time depoends very much on the traffic at the border, but on a good day about 3 or 3.5hrs is realistic. It's best to travel in the middle of the day, and go mid-week. At weekends the border is horrendous, paticularly saturday mornings and sunday evenings.The SME departs from Kallang Bahru Complex, which is easy walking distance of Lavendar MRT. (some sites still say Golden Mile, but this has changed since Golden Mile was redeveloped). It arrives at Melaka Sentral bus station in Malacca.
Note that at the border you have to alight and reboard twice with all your belongings (once for Singaporean side, once for Malaysian side).
Once the borders are dealt with, the route is good. Outside of the city centres, it's expressway all the way.
The nearest rail station is at Tampin, which is on the West Coast mainline (Singapore-KL-Butterworth). All KL/Butterworth/Had Yai bound trains stop there. From Tampin you need to get a local bus into Melaka, allow about 45 mins. The old station in Singapore closed last year. Now you need to go to Woodlands Checkpoint (which is NOT Woodlands MRT, though there is a frequent bus between the two) and pick up the train there. It's really not worth the hassle though.