The main difference is that the HF M500 has the HD CMOS PRO image sensor, which is the same sensor Canon puts in their professional camcorders. The overall image quality will be better and do better in low light. The HF M500 has a lens filter at the end of the lens; you can screw on filters such as a UV or ND filter or a wide angle/telephoto lens. The M500 also has the proprietary Canon shoe for connecting accessories such as a Canon light or Canon microphone.
There are cheap adapters, from about $10-$20 that can convert it to a universal shoe for non-Canon accessories - although with the adapter the camera's battery can't be accessed...for example, your microphone would need its own battery inside of it. If proprietary Canon mic, it can use the camcorder's battery for power.
The HF M500 will also have better audio capabilities.
The HF R400 has a couple of things the M500 doesn't; such as 60p and MP4 recording...I think the better sensor/image quality alone on the 500 overrides that.
It wouldn't be horrible to get the HF R400, but those are basically the differences.