They were larger but not as dense as mammals, we know had adaptations like less denser bones and different respiratory systems that allow for more efficiency and much more rapid growth into maturity. Modern birds show evidence of all these traits. When the Chicxulub extinction event happened it reset things so mammals got the upper hand on large sizes and eventully won out for the most part. Highly recommend The Rise and Fall of Dinosaurs, which I thought was going to be mostly stuff we learned as kids but was educational for me.
You are right that they had pneumatic bones and air sacs and they were not as heavy as mammals with the same volume would have been.
Nonetheless, the biggest dinosaurs were several times heavier than the heaviest terrestrial mammals that have ever lived, which in turn were several times heavier than the biggest elephants of today.
So probably dinosaurs were close to the size limit that is imposed by the mechanical properties of vertebrate tissues like bones, tendons and muscles, while in the present terrestrial mammals the size is limited by the availability of food and by the humans who have always hunted preferentially the biggest animals they encountered, and not by the strength of their bones.