We own both vehicles.
The Mazda 3's road handling is definitely better and it is a lot of fun to drive. The 2L + 6AT is a very good combination.
The sedan has 12.4 cubic feet of cargo, compared with 20.2 in the hatchback, which also looks better and has more utility. It now shares the same infotainment system with the CX-5 (and 6).
The downsides of the 3 are door opening for the back seat is a little tight and the back seat is a bit low. While there is definitely more space in the CX-5, the 3's is not too tight, especially for average height people or kids. In addition, there is more road noise, especially from the tires. While you drive lower to the ground (which is better in my book), visibility is very good.
The CX-5 has 34.1 of cargo volume, more spacious back seat, though the door opening is still not ideal. While it handles very good for a CUV, it is definitely not as good as the 3. However, it has a better ride quality and less road noise but a little more wind noise. Obviously, it gets less miles to the gallon, being heavier and with larger frontal area and more drag.
There is not much info on the CX-3, but I suspect it will be even worse in the back seat and cargo area. It's going to be 7.3 inches shorter than the Mazda 3. Not sure about ride and handling, as it might be slightly lighter than the 3. It is definitely slower than the 3.