Add olive oil and butter to a medium saute pan over medium heat. Add sliced onions and season with salt and pepper. Cook and brown onions, stirring occasionally, until caramelized, about 18 to 20 minutes. Add garlic and cook for one minute more. Remove pan from heat, add balsamic vinegar and set aside.
In a large bowl, toss together clean cherry tomatoes (no need to cut them), chopped basil, flour, and red pepper flakes. Add caramelized onions and toss together until everything is lightly and evenly coated in flour. Season with salt and pepper.
Place rack in the upper third of the oven and preheat oven to 375 degrees F.
Pour the tomato and onion filling into a square 8×8-inch baking dish. Place in the oven and bake tomatoes filling for 25 minutes.