I took the train a couple of times from Kayes to Bamako, but not with a bike. The last time I was on the same platform as a Swiss guy on a new Varadero or whateverthey are called. He had the idea of laying the bike flat onto four old tyres and strapping them down, it worked fine, no damage. I think he paid CFA28,000 but I can´t really remember. A car costs CFA70,000. This is from Kayes to Bamako.
In Bamako I suppose you´ll get hassle from various `Grand Chefs` and `Grand Experts`, one particular bastard to watch out for is a guy about 40 with a beard and a Marlboro cowboy hat. He tends to call the shots and try to pull cash off you. The bike will probably have to be lifted onto the platform, so I guess this will cost 5,000 or so. How they tie it down in Bamako I don´t know but the train is a very shaky ride so keep that in mind.
The road to Bafoulabe/Mahina is actually quite good and from the border to Dakar it is tarred all the way, most of it new. As far as I know the goods train in Mali goes about five times a week but the international one to Dakar once a week or so.
Personally I would think of driving to Mahina via Manantalis, putting it on the train there and taking it off in Kayes. The road to the border is about 85km and OK with as motorbike.