Six people were killed and about 80 injured when a train derailed near the Moroccan capital Rabat on Tuesday, officials said.