Part of the answer depends on whether or not shooting in 4K is important to you and that is something only you can decide. Are manual controls important to you?
Canon G40 probably has better low-light performance than the Sony.
Not that this is a deal breaker but the Canon has a slightly larger touch screen than the Sony (3.5" vs 3").
According to the reviews of the Sony FDR-AX53/B one drawback is that you are only allowed to change one manual setting at a time. This means if you adjust the aperture the other adjustments are made for you based on the aperture setting you choose. Another known issue for the Sony camcorder is camera shake/stuttering when placed on a tripod. This issue is not reported when shooting handheld. I'm not trying to be negative and I don't have a bias either way (own both Canon and Sony camcorders). Most users seem to be very pleased with the image quality.
For better information than I can give you on the Sony visit the
Sony Forums and see what users of the camcorder have to say about it. Link to thread regarding
camera shake.
Side-by-side comparison of specs from B&H.
I have a Canon HF-G20 (two models older than the G40) and I have no complaints. I like the ability to control different settings and the image quality is great. The Sony camcorders I have are older tape based camcorders so I have nothing worthy of comparison to the newer models. However, the old Sony HDR-HC1 (miniDV) camcorder does shoot quality video so if the newer Sony's have even better image quality then you would be well pleased with the quality of the recording.
If you like better low-light performance and more control go with the Canon HF-G40. If 4K is important and you have a computer that can handle the editing workflow then go with the Sony FDR-AX53/B.