So I've been staring at this for a moment:
(https://i.imgur.com/UM87EiG.png)
As far as I can tell, what this says is that the higher rank weapon is unambiguously worse. It does less damage for more energy in the same mass; is harder to hit but has less HP so I'm guessing the overall average lifespan is going to be close enough. That 7% difference in heat generation seems to be too small to matter also.
I don't get it. Does somebody get it?
Edit: The beam cannon is also prettier. :P
Guns aren't always directly comparable to cannons of other ratings, especially at lower ratings because there isn't a huge range of available values at those ratings. There are only 9 non-special ratings used in the game (1~9), and all item types use a separate scale for their base values, so comparing low-rating items across different types may find some unexpected overlaps like this.
Cannons are intended to be better than guns, as long as you can afford any additional costs they incur, and because cannons of rating X are better than guns of rating X, they may very well also be somewhat better than guns of rating X+1. (Beam Cannons are also much more rare than Beam Rifles, because the latter is commonly used by the enemy.)