How can something "legally" be what it scientifically isn't?
When interpreting laws, courts are supposed to consider the ordinary or common meaning of words, not the technical meaning, unless the context clearly requires otherwise. The word "vegetable" was not used in a scientific context, but in a commercial one; therefore, it would include tomatos.
I would add that, while "fruit" is a botanical term, "vegetable" does not have any scientific meaning. Thus, to call the tomato a "vegetable" is not scientifically inaccurate.