Preheat the oven to 375°F or 190°C. Lightly grease a 9-inch baking dish that gives the apples enough room to cook evenly.
Add the sliced apples to the dish and drizzle them with lemon juice. Toss gently so the fruit is coated and less likely to brown before baking.
Combine brown sugar, granulated sugar, cinnamon, cornstarch, and salt in a small bowl. Sprinkle the mixture evenly over the apple slices.
Pour the melted butter and vanilla over the fruit. Stir carefully until the apples look evenly coated with the cinnamon mixture.
Cover the dish with foil and bake for 20 minutes. Remove the foil, stir once, and continue baking uncovered for another 8 to 12 minutes.
Check that the apples are tender but still holding their shape. Let them rest for 5 minutes so the sauce thickens, then serve warm.