In a large pot of boiling salted water, cook the corn until tender, 5 to 7 minutes. Remove corn with tongs and set aside on a cutting board to cool. Using a strainer, remove any corn silk remaining in the pot.
Add the green beans, return to a boil, and cook until very tender, about 8 minutes (timing may vary depending on the size of the beans). Meanwhile, cut the corn kernels off the cobs and put kernels in a large bowl. Drain the beans in a colander, shake to remove excess water, and put in bowl with corn. Add garlic and 3 tablespoons of oil. Toss well and let stand at least 30 minutes for flavors to blend; refrigerate if longer than 30 minutes.
If necessary, bring beans and corn to room temperature by removing them from refrigerator 30 minutes before serving. Just before serving, remove the garlic and add the remaining tablespoon of oil along with vinegar, onion, and tomatoes. Add salt to taste and serve at room temperature.