Vyxal, 8 bytes
ṡ:²∑$∑²ε
How?
ṡ:²∑$∑²ε
ṡ # Inclusive range between (implicit) second input and (implicit) first input
: # Duplicate this range
² # Square each of the duplicate
∑ # Summate
$ # Swap so the other range is at the top
∑ # Summate
² # Then square
ε # Absolute difference between the two