Pull them off the bike, remove the headlight ears, and de-rust them. Only once you remove the rust can you determine whether they are still structurally in tact. If the rust doesn’t travel past the seal, they won’t leak, but I’d be very concerned if they’ve rusted to a point where the tubing up top hasn’t been dismissed in strength.