if they both weigh the same, then you look at other factors:
the carbon bike might be stiffer, so it'll be more efficient getting your effort to the wheels.
the carbon bike might be more aerodynamic, but whether that helps will depend on how fast you're going in the first place.