I took a 3hr 15min train ride from Marrakesh to Casablanca yesterday in their ‘first class‘ cabin. Purchasing train tickets in Morocco is easy since most of the ticket attendants speak English, Moroccan and sometimes French. You can usually purchase tickets for same-day travel; I still advise that you purchase them 24 hours in advance to be safe.
You can only buy train tickets when you are inside of Morocco, the government prohibits ticket sales to anyone outside of the country. However, it is simple to get to the train stations once you’re in Morocco, taxi drivers know how to get to the train stations.A one-way ticket from Marrakesh to Casablanca in first class is 140 Dirham, second class is 90 Dirham. First class has more seat space and legroom. It is also supposed to be cleaner.
The trains are usually on time and you should arrive at the station 30 minutes before your scheduled departure time.
The train does come with air conditioning, so you do not have to worry about dying from a heat stroke. In the first class cabin there are 9 compartments, each compartment seats 6 people.
Food is inexpensive on the train, I bought a sandwich with beef and lettuce (and olives that I removed) for only 20 Dirham. A 16 fl.oz. bottle of water was 7 Dirham. They also had sandwiches with just cheese or with chicken available, all for 20 Dirham as well. A picture of my sandwich is available below. During Ramadan there will be no food for sale and you should probably avoid eating in public out of kind respect.
Taxi drivers like to (persistently) persuade you to take their service, some people even impersonate being ‘official’ guides. If no one in specific is picking you up from the station simply barter with the taxi drivers for a ride to your hotel, hostel, riad or wherever you are headed to.