There is (was?) an effort to restart Airships for cargo traffic. They solved the ballast issue with onboard compressors. If understood it correctly that solved this problem complete with [effectively?] no loss of lift gas.
For hydrogen you I guess you could either let it go or also use the compressors in case there is no way to replenish the lifting gas & you might need the extra lift before returning to your primary maintenance base.
But yeah, simply running a compressor powered by hydrogen should suffice. I assume the airships would require some surplus hydrogen anyway, in case there's a mid-flight leak or something.
The corollary pipe dream here is to line the entire interior of the envelope as a fuel cell membrane and use the airship as a portable battery.