Bring broccoli and onions to a boil in a pot of salted water until vegetables are tender, about 5 minutes. Drain. Arrange vegetables in a baking dish.
Melt 2 tablespoons butter in a saucepan over medium heat; cook and stir flour, salt, and pepper into melted butter until smooth, about 2 minutes. Whisk milk into flour mixture until thick and bubbly, about 5 minutes. Reduce heat to medium-low and add cream cheese. Stir until smooth.
Pour cream cheese mixture over vegetables, stirring lightly. Top with Cheddar cheese. Combine 2 tablespoons melted butter with bread crumbs in a bowl; sprinkle over vegetables.
Bake in the preheated oven until cheese is melted and bread crumbs are golden brown, about 30 minutes.