The railways do not care who is travelling. Trains do not have passenger manifests, there are no pre-boarding ID checks. If you had bought this ticket at a ticket office at the station there would have been no names at all on it.
Trains operate on a "proof of payment" principle. The railways are only interested whether you paid.
Tickets bought at the station will be printed on special ticket paper, which allows the conductor to see that it is indeed genuine, and that you paid the price that entitles you to be on that train.
But tickets bought over the internet, and printed out by yourself are not printed on special ticket paper. So the railways need something else to protect themselves against people just whipping up a ticket in photoshop, or buying one ticket and handing out copies to friends. And that they do by asking for a name, and encoding that name in the QR code on the ticket. This on the theory that we cannot yet copy people. The conductor scans the QR code and looks at the name that will appear on his terminal. The ticket is then valid if the person with that name is part of the group travelling.
There is an official TSI electronic ticket standard, which is what DB, ÖBB, SBB, and many others use (and which should be eventually be used Europe wide). Thanks to this standard DB can sell e-tickets that for example an SBB conductor can verify. In this standard they even have a name for the person mentioned on the ticket: The "head of the party". And his or her name is only on the ticket for fraud prevention purposes. A ticket will thus have "John Doe" on it, and for example the mention "2 adults", which basically means that two adults can travel on that ticket, and that one of them must be called "John Doe", for the ticket to be valid.