Preheat oven to 350 degrees F (175 degrees C). Grease a 9x13 inch baking dish.
Melt the butter in a large skillet over medium heat. Stir in the onions and garlic; cook until the onions soften and turn golden brown, about 10 minutes. Add the butternut squash and brown sugar. Continue cooking and stirring until the butternut squash begins to brown on the edges, but is still somewhat firm in the center, about 10 minutes more. Scrape the squash into the prepared baking dish, and pour in the chicken broth. Wrap tightly with aluminum foil.
Bake in the preheated oven until the liquid has been absorbed and the squash is tender, 45 to 50 minutes. Toss together the Gruyere cheese, Cheddar cheese, bread crumbs, thyme, and rosemary in a bowl until evenly combined. Remove the foil from the baking dish, and sprinkle the squash evenly with the cheese mixture. Sprinkle the Parmesan cheese on top. Return to the oven, and bake uncovered for 15 minutes more until the topping is lightly crunchy and brown.