"Tomatoes and cucumbers are vegetables."
Translation:עגבניות ומלפפונים הם ירקות.
Well, ירוקים is not correct, because it is an adjective "green". Here you have ירקות which is a noun "vegetables". Two totally different words.
As for you other remark. That works for adjectives. "Vegetables" is a noun, and it never changes gender. It will always be ירקות in plural (and it is actually masculine, even though it has ות ending).