Heat oven to 400°F. Toss tomatoes and mushrooms with 2 tablespoons oil on a baking sheet. Spread into a single layer and season with salt and pepper. Roast in lower third of oven until softened and browned in places, about 20 minutes for the mushrooms and 30 minutes for the tomatoes. (Transfer mushrooms to a plate while tomatoes finish cooking.)
Meanwhile, brush both sides of bread with 2 tablespoons oil, then sprinkle with salt. Place on a baking sheet and bake in the upper third of oven until crisp and golden on the edges, about 10 minutes. Rub tops of toasts with cut sides of garlic and return to baking sheet. Fold a slice of ham over each toast and return to oven to warm ham while you fry the eggs, about 3 minutes.
Heat remaining 2 tablespoons of oil in a large non-stick frying pan and fry eggs to desired doneness. Remove toasts and tomatoes from oven, place a tomato and some mushrooms on top of the ham then top with a fried egg.