Sure, you could buy a sheet cake and frost it with a picture of a train. But what about building a train out of cake? That's what we're talking about here. Creating a train cake will take time, patience and probably some baking pans you might not already own (depending on the recipe you decide to use -- do an online search for a variety of train cake recipes).
Be creative with the kinds of train cars you make -- this doesn't have to be Thomas the Tank Engine (unless that's what your child would like). Add a coal car, a caboose, whatever you imagine. Consider using candy to decorate the train after it's been frosted -- and don't forget to put down some licorice train tracks!