I would guess if the guns were of equal mass, the difference would be negligible.
Muddying the waters a little further, I think your comparison of 2 inch barrel vs 12 inch barrel makes the implication that the bullets acceleration is slower, spread linearly over the 12 inches of barrel, to reach the same comparison velocity. In actual practice, the acceleration is non-linear. It will be variable, but generally by the time a bullet is 2 inches down a 12 inch barrel, it will already have most of its velocity (guessing a bit here, maybe 66-75%?).
I think another interesting comparison would be to shoot a .40, and alongside that shoot a revolver of as much comparable caliber, bullet weight, and muzzle velocity, to compare recoil. The revolver lets you feel the recoil of the shot, directly. With the auto, at the moment the shot is fired, the slide absorbs a large portion of the recoil, but then at the end of the slide travel, it hits the stop like a hammer, and flips the muzzle up, then on the return trip, goes into battery, again hitting like a hammer (with less force than the first impact) and flipping back down.
sorry if i've overthought this, or gone off topic. the discussion just set me off a'thinkin...