Both sentences are almost correct but differ slightly in grammar.
"Tomatoes are my favourite vegetable."
This is more common because "vegetable" is being used as a category or class of food, which is singular. You're saying that tomatoes are your preferred choice in the general category of vegetables.
"Tomatoes are my favourite vegetables."
This is also grammatically correct, but it's more literal. Here, you're treating "tomatoes" as individual items and stating that all the tomatoes are your favourite vegetables, which emphasizes the plural form.
In everyday usage, the first version is more natural