Sorry I wasn't clear. Joao's suggestion will not work.
elisp-flymake--batch-compile-for-flymake invokes byte-compile-file in a subprocess which loads the input file into a fresh buffer with reset buffer locals, negating the parent-process call-site patch's intention.
Disabling no-byte-compile has to happen in elisp-flymake--batch-compile-for-flymake to influence byte-compile-file. I've used a new defvar to let bind in the spirit of bytecomp--inhibit-lexical-cookie-warning.
I've attached a patch that works for me, along with an appropriate commit log message.
-Stephane