Well, let's be careful not to mix apples and oranges. Looking at Hodgdon's data for 348 Win, it shows lower velocity and pressure for H4831 with a 200-grain bullet and a large compressed charge than for a maximum load of 3031 because H4831 is really too slow burning for that combination in the first place. Hence the velocity advantage that may be gleaned from 3031, but it's not due to barrel length. It would be true with a 26" barrel, too. Hodgdon's 250-grain bullet data makes H4831 look better, but the bullet is a Barnes solid, and the higher start pressure is a significant factor in getting H4831 to burn, especially at 348 Win pressures. A 250-grain cup and core would still not work as well with H4831.
In 308 Winchester, Hodgdon data shows you should not, at the same peak pressure, be able to beat 4895 for velocity with 3031 until you are using bullets 125 grains or less for their 24" test barrel. For a 16" barrel, velocity differences are not too far apart even with 150-grain bullets, but 4895 should still win. If you are seeing a velocity advantage to 3031 there, the peak pressure is higher.
As a general rule of thumb, the powder that produces the highest velocity with a 24" standard test barrel will still produce the highest velocity with a 16" barrel, though the difference between faster and slower powders will have diminished at that length. Which powder produces the greatest velocity will start to change order among some choices when you get down to SSB lengths. Mostly, though, you are going to need to be under 12-inch barrel length for that to begin to get noticeable. Maybe 9 inches or so.
The main advantage to a faster powder in a short barrel is the flash and muzzle blast reduction. The military accepts higher pressure in the M855A1 Enhanced Performance cartridge in order to use a faster powder to help reduce those factors in the M4's barrels and the even shorter spec ops weapons. There is a trade-off, though, and they've reported problems with faster throat wear.