However I don't have much time to test the Java code, you can find support from other members.
Below is the CSS, which also helps you to solve the problem, but it's quite manual, you need to insert code into all Page Headers.
To hide Footer German Section on English Pages, add this code into All English Pages Header
to hide Footer English Section on German Pages, add this code into All German Pages Header
If you want to find data-section-id in future case, use this tool. https://chrome.google.com/webstore/detail/squarespace-id-finder/igjamfnifnkmecjidfbdipieoaeghcff?hl=en