Dual-rail encoding with superconducting cavities