I'm assuming that Apple's design boffins figured - incorrectly, as it turns out - that the design was public domain. Whoopsie!
That having been said, $21 million is probably cheap compared to the litigation costs if this thing had gone to trial. Apple would almost certainly lose, and be held liable for damages as well as being penalized.
In the end, $21 million is probably a good deal.
Also, we don't know what else might be a part of this deal. Maybe the Swiss Railway has agreed to partner with Apple on some other product - Passbook or something - which caused Apple to sweeten the deal.
Apple may have also bought exclusive digital rights to the design, so NOBODY else can have it. That's also worth some bucks.