It will come as no surprise to anyone that EE bays are well protected with the sort of things you have described.
The 787 batteries are also in separate EE bays. Main one in the front and the dedicated APU battery in the power electrics bay aft of the landing gear.
They are both contained in fireproof boxes that will vent to atmosphere in the event of a thermal runaway.
I have been working on 787s for over a decade and leaks from gallies and lavs has not once been on my list of snags.
The first B744 flood event in the E&E was 25 years into the operation with one airline, and the other 2 occurred over 30 years into the operation of the type, one was uniquely a cargo loading event, and how the OEM would have guessed that some carrier would enter a wading pool worth of rain water into the E&E, they had and have my sympathy. We took action after that to avoid a repetition, but it wasn't on the radar before it ended up with a bit of excitement for the crew. They happened to have a nice clear evening when the whole cockpit went darl. The B787 has a AD out since 2016 which was added to last year related to unwanted leaks. My own event with a B777 ended up with over 6 cubic meters of ice in the belly of the B773ER, and was only found doing a walk around where there was a number of the belly drains drooling onto the ramp, which happened to be dry. An event external to the system architecture remains a high probability, and as unusual as that may be it is not without precedent, with existing AD's related to such matters extant.
When pax flush clothing and other rubbish down a vacuum toilet system, the potential for stuff to not work as advertised is not zero.