Total cost and total revenue are completely useless when comparing airlines. The only way to make appropriate comparisons is to do a weighted comparison. The simplest method of weighting is by ASMs, hence CASM and RASM.
Sure, revenue has to be more than cost. So, in your example of the A330, the CASM is lower than for the RJ...but the RASM is much lower, since the R has to be amortized over a much larger number of ASMs. It works.
The reason the RJs don't make sense is that they're being used to displace 737s on routes with sufficient demand to use a 737. That doesn't make sense. RJs are fine in markets that are too small to support a 737 in the first place...provided the customers in those markets are willing to pay for the service in the first place.
Sometimes you end up with a market that is too small to support a 737, so you want to put an RJ in there...but the customers that would fill the RJ won't pay the necessary fare to make the RJ profitable, so the market shrinks further. Eventually, the RJ gets replaced with a Saab, but the tiny handful of customers that were willing to pay the RJ fare won't touch the route at a fare that makes the Saab profitable. And so the market becomes unserved altogether.