If you can get a high enough shutter speed with the 400/5.6, that's sharper than the 300/4. Both are very slightly sharper than the 100-400, but there is copy variation to consider, so you may find some 100-400s that best the 400/5.6. The 70-300L is sharper than all three.
Wide open, yes. But at 300mm f/5.6 (the best both zooms can do at that focal length), the ISO 12233 test chart appears to show the prime being sharpest, followed by the 70-300L and then the 100-400.