How can sodium be reduced in the Castner–Kellner process?
I am not sure if you are familiar with the term "overpotential." With mercury electrode, as a cathode, it takes more negative potential to reduce hydrogen ions to hydrogen gas, rather it is easier for sodium ions to get reduced on a mercury surface and form an amalgam (an alloy of Hg and Na). This is a peculiarity of the mercury electrode.

Mercury cell in chlor-alkali industry