The definition of the cathode and anode don't depend on which electrode is at a higher or lower potential, but on which direction the current flows.
The cathode is the the electrode by which electrons enter the device from outside. Put another way, it is the electrode that conventional current flows out of.
In the case of a cell providing power to a circuit, it is the terminal with more positive potential, from which conventional current flows into the circuit.
In the case of a pn-junction diode it is the n-side of the junction, which will be at a less positive potential when the diode is in its conducting state. (Very pedantically, we might reverse which terminal we call cathode and anode when the diode is reverse biased, but practically we always call the n-side of the junction the cathode)
In the case of the x-ray tube, electrons must enter the device at the cathode terminal in order to be emitted into the tube and eventually strike the anode to produce x-rays. This means that conventional current will be flowing out of the cathode.
The point of commonality is that conventional current flows out of the cathode, and into the anode.