German trains (or more specifically, trains run by Deutsche Bahn/DB , which is the only really major train company in Germany and the one that ran Thunberg's train) take on more passengers than available seats. It is possible to place seat reservations in advance in addition to the purchase of your train ticket. If you don't make a reservation, you can still get on board of a train you have a valid ticket for, but if the train is crowded, you may have to stand in the aisle for the duration of your journey. Some people (mostly younger passengers) prefer to sit on the floor to standing, but this is absolutely not compulsory.
If a train for which a reservation has been made is cancelled, DB is no longer obliged to guarantee a seat on the replacement train (in fact, this would pose quite a logistical challenge so I can see why they do that). The reservation price can be refunded in these cases, but passengers from the cancelled train may not find a vacant seat on the replacement train.
The tweet by Thunberg was posted on December 14, 2019. Indeed, on that day there was a train cancellation on the line between Basel and Hamburg, the line on which Thunberg was travelling. According to the website www.zugfinder.de, which archives German train connections and offers free access to the last 30 days of their database, DB did cancel ICE 78, which was originally scheduled to depart from Basel at 7:06 and arrive at Hamburg at 13:52 ("Zug ist ausgefallen" means "train was cancelled"):

So, what apparently happened is this:
- Thunberg buys a ticket for ICE 78 from Basel to Hamburg (departure 7:06). It is unclear whether she also made a seat reservation for this connection.
- ICE 78 is cancelled.
- Thunberg gets on a different connection from Basel to Hamburg. Any seat reservation becomes void at this point.
- Thunberg can't find a seat on the replacement trains and decides to sit on the floor (in her later tweet, she says that she was on two different trains before she reached Göttingen, which means that she probably changed trains in Mannheim and later in Fulda).
- Thunberg has someone take a photo of her sitting on the floor en route to Göttingen.
- Changing trains in Göttingen again, Thunberg finds a seat for the duration of the journey between Göttingen and Hamburg.
- Later that day, Thunberg posts the photo on Twitter.
- On Sunday 15, 2019, Deutsche Bahn responds on Twitter, which discloses the train number of Thunberg's train from Göttingen to Hamburg and which contains a snide remark that this part of her journey was indeed in a first class compartment.
To anyone who has traveled with Deutsche Bahn, this will sound like a very familiar experience: nothing in this reconstructed chain of events is in any way spectacular, with possibly the exception that DB responds to a post on Twitter. In fact, this is the only thing that is actually kind of noteworthy (as @tim pointed out in a comment). Here's what they posted in their tweet:
Liebe #Greta, danke, dass Du uns Eisenbahner im Kampf gegen den Klimawandel unterstützt! Wir haben uns gefreut, dass Du am Samstag mit uns im ICE 74 unterwegs warst. Und das mit 100 Prozent Ökostrom. Noch schöner wäre es gewesen, wenn Du zusätzlich auch berichtet hättest, wie freundlich und kompetent Du von unserem Team an Deinem Sitzplatz in der Ersten Klasse betreut worden bist.
"Dear #Greta, thank you for supporting railways in the fight against climate change! We were happy that you traveled with us in the ICE 74 on Saturday. And with electricity from 100 percent renewable sources. It would have been even nicer if you had also reported how friendly and competently you were treated by our team at your seat in first class." (my translation)
I can see that this response stirred some public attention, and there's currently a discussion about DB's "passive-aggressive" tone (as @tim called it in his answer) and whether DB violated Thunberg's privacy by disclosing this information. But the fact that she sat on the floor on a German train is really a non-event.