Much of the material on LibGen would be legally accessible under the copyright terms in which it was originally published, but that their exclusivity has been retroactively extended.
Meh, as long as their servers aren't in those countries, they can't do anything except censor the website. And most countries with long copyright terms don't censor websites.
If they did not have servers in Germany couldn't they have just ignored the lawsuit?
They can make it illegal for Germans to use the site if they wish, but they can't go meddling in foreign media content. If Saudi Arabia serves you a lawsuit because you have a picture of a woman's face on a webpage without hijab, would you fly there to go to court? I'd just trash their lawsuit and never go there. They can block my site if they want -- same goes for Germany.
They explain all this in the notice I linked above:
...
Because PGLAF operates as a legitimate non-profit organization, however, it is appropriate to act as the German Court ordered - pending appeal - even though it disagrees with the order.
...
The decision to acceed to the German Court's order to make items inaccessible from Germany is intended to be a temporary appeasement, while the appeal occurs - this is because the German appeal Court will likely look disfavorably on PGLAF if it shows contempt for the German Court. Ultimately, PGLAF seeks to establish that any complaints about copyright must be brought either to the US Courts (where PGLAF operates) or WIPO processes (as guided by international treaties).
That's one of my go-to examples as well. I mean, even excluding porn and soft porn, the vast majority of Western media is likely illegal in Saudi Arabia.