Complex sentence: First, second or third class compartments were available, first class carriages having four compartments, the others five.
Split into simpler sentences: First, second and third class compartments were available. First class carriages had four compartments, the others five.