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.
5whiskey,
Going with a fast-for-caliber powder will cut the muzzle flash and blast, but will cost you a little velocity when the peak pressures match. If you are going for light or moderate loads, though, it can be just the ticket and will perform better in terms of velocity consistency and usually in terms of fouling, too, when the pressures are on the low side.
Slow powders get their velocity advantage from keeping pressure up in the barrel past the peak. As a barrel gets shorter, that has less advantage to bullet velocity because there is less length past the peak in which post-peak barrel pressure can further accelerate the bullet. Slow powders also often peak when the bullet is a little bit further down the barrel than where faster powder peaks, and that affects the point at which a faster powder starts to get more velocity than a slow one does. But those differences are on the order of half an inch to an inch, typically, so you can't expect to get fast powders to produce more velocity than slow ones until that short difference become significant to the total bullet travel (the length from the muzzle to the position of the base of the bullet at the moment the gun starts to fire).