Me and my missus have just had 4 nights each in Marrakesh and Fes. If you can only choose one then go for Marrakesh. It's 'in your face' all the time and you'll never get bored. Fes is a little more laid back. Apart from the human attention you'll get in the souqs the lanes can be a pain due to the number of mopeds and cycles that seem to think they've got right-of-way. There are other, more acceptable, hinderances. Make sure you take out adequate travel insurance!
If you decided to visit both and bridge the gap by train, then as already mentioned it is a full day. The train will get full, and depending on those around you could make ith either an enjoyable experience or one to forget. Train tickets are relatively inexpensive, and the trains are fairly comfortable. Try to sit in an open compartment, rather than an eight seater (2nd Class) /6 seater (1st Class) compartment, and try and sit on the side that is shaded from the sun. Take your own food and drink.