Yeah, Bruce has it right. What Bruce is calling an "out of the box speaker" is normally called a dipole enclosure. The dimensions of the baffle shape the frequency response curve of the speaker. The "speaker in a box" is normally called an acoustic enclosure. The volume of the enclosure shapes the frequency response curve of the speaker. Either could be designed (tuned) to give the desired response curve providing it is within the range of the speaker driver being used. Neither is better than the other. It is a matter of tuning. Bruce's speaker in a box sounds poor compared to the out of the box speaker only because the enclosure (the box) is not properly tuned to the speaker driver.
Although, I tend to agree with him that a dipole enclosure (the shell) is a better arrangement for a model locomotive because a) a correctly sized acoustic box would be prohibitively large for most locos; b) there are insufficient specifications available for little cheapie speakers to correctly design an acoustic enclosure; c) ease of construction and mounting.
Models aside, the acoustic enclosure will have a flatter, more accurate and even frequency response (desirable) than a dipole. Comparatively, a dipole enclosure will always have a more peaky response (undesirable) than an acoustic. On the plus side a dipole will have a higher SPL (volume) than an acoustic because the dipole has no external dampening. That's important given the limited wattage available from decoders.
A hybrid of the acoustic and dipole is a Helmholtz resonator enclosure often called a ported or bass reflex design. This type enclosure would be ideal for a locomotive as it can be tuned to really boost the bass response of a speaker driver that otherwise could never go so low. Sadly a properly tuned resonator enclosure would not come close to fitting in any locomotive short of G scale.