We examine the origin of molecular gas heating in a sample of 42 infrared-luminous galaxies at z<0.3 by combining two sets of archival data: first, integrated CO line luminosities in the 1–0 and 5–4 through 13–12 transitions; second, results from radiative transfer modelling that decompose their bolometric emission into starburst, AGN, and host galaxy components. We find that the CO 1–0 and 5–4 through 9–8 lines primarily arise via radiative heating in the starburst and the host galaxy. In contrast, the CO 10–9 through 13–12 lines may arise primarily in the starburst and AGN, with an increasing contribution from mechanical heating and shocks. For the sample as a whole, we find no evidence that AGN luminosity affects the heating of molecular gas by star formation. However, for starbursts with low initial optical depths, a more luminous AGN may reduce the efficiency of starburst heating of the CO 5–4 and above lines, consistent with negative AGN feedback.