PS/2 and USB Human Interface Devices work via messages, not via an 'up' line, a 'left' line, and so on. These messages have to be decoded for them to mean anything. As such, a simple motherboard fault was already unlikely, and you have ruled this out by swapping them around.
The most likely reason was with the mouse hardware, but as you have swapped those around, it cannot be that, and you have also tried both roller and optical ruling out surface issues.
Presumably you have tried different, clean OS installs when you say that the problem also presents under XP, ruling out the second most likely reason, software problems.
Lucio has the only possible explanation. Intermittent Contact is being made somewhere between your motherboard and case (and/or potentially between other components) when the temperatures get hot, most likely near the USB connections, their lines and the chip they connect to. You have been lucky it seems, this is only manifesting by the mouse moving, when it could have done worse!