Quick answer
In most cases, CNF is better. CNF means confirmed berth, while RAC generally means shared berth with a possible upgrade.
When CNF matters
CNF should be judged by passenger-wise status, chart timing and recent movement in your PNR.
When RAC matters
RAC can behave differently by quota, train route and cancellations. Always check live status close to departure.