These are usually not used together at the same time in the same VM. [1]
But if you’re using these together, just use another port.
[1] (And no, Bitcoin How-to: Use ElectrumX Personal Server in Whonix doesn’t contradict that because in that setup, electrum
doesn’t have internet access.)