Trying to buy some, I find small wheels that measure 24.5 mm and large wheels that measure 31 mm.
Ah, looks like you have found the Bachmann wheels. By default, get the big 31mm ones. The smaller 24.4 ones are more for 'special' applications.
Opinions vary on the quality of these, but, overall, they do the job, and are economical. And, yes, diameter is taken at the middle of the tread.
Treads are tapered, as Greg said. Reason for this is to help wheels fixed rigid on the same axle, get around curves (you thought that's what flanges were for).
You see, on a curve, one wheel has to travel further than the other. With a tapered tread you, in effect, have a range of diameters, and the wheelset 'adjusts itself' sideways so that the individual wheels end up travelling their proper distance. Sometimes, what you think is flange squeel, is in fact the tread skidding when one wheel can't keep up with the other.
I recall inspecting a brand new wagon after it had travelled 400 miles from its builder.... the treads were all nice and shiney, and all the flanges were still rusty.