You are correct, the X/Y lattice vectors must be commensurate for heterogeneous systems.
This is quite trivial to ensure in systems where you can just add some vacuum padding, but if the two electrodes are constructed from e.g. two different metals with different lattice constants, one has to strain one material. In this can one can try to find a particular supercell combination (like 2x3 on the left and 3x4 on the right, or something else) that minimizes the required strain.
I think the first way for using different electrodes in different materials is more useful. In this way, we can use a large xy surface and just make a (1,1) k-point calculation for the scattering region at the xy direction. At the same time, the electrodes are not necessary to chage their lattice constant. But for the electrode calculation, we can set k points for the Kz direction, while also use (1,1) for the xy diretion.
Lage xy surface seems to burden the computation, however the Gamma K point calculation will compensate for this.
However, I doubt for different electrodes calculation, whether we need to inlculde large number of screeing layers since there are large charge tranfer between the left and right electrodes for their different chemical potential?