If it makes it easier to swallow, think of it as a Class J training vessel
I'm just fine with imagining an outdated Class J starship serving as a training vessel for cadets, especially since many of our training vessels
are sometimes really old.
Although one could argue that Class J doesn't indicate size since Spock indicates Mudd's ship as a "small Class J cargo ship". He probably wouldn't need to point that out unless it wasn't part of the description.
Very good point, "Class J" is apparently no indication of size and tonnage, because Spock usually doesn't provide redundant information.
With Commodore Mendez' statement (at McCoy) it is not entirely clear whether he meant "old Class J" or just "old starship", but maybe the alphabetical class isn't an indicator of age neither.
And how can you determine the stardrive / warp capability of any vessel with your scanners if said ship, for example, was running on impulse?
Maybe the alphabetical classification refers to the energy output a certain vessel is capable of. Wouldn't that be the first thing to register on your scanners ("Class J vessel of some kind, which now appears to be some kind of cargo ship according to our sensors")?