Peel and finely dice the apples.
Add apples, brown sugar, butter, cinnamon, nutmeg, and lemon juice to a small saucepan.
Cook over medium heat for 4–5 minutes, stirring occasionally, until the apples begin to soften.
Mix cornstarch and water in a small bowl.
Stir the cornstarch mixture into the apples and cook for another 1–2 minutes, until slightly thickened.
Remove from the heat and allow the filling to cool.
Preheat the oven to 350°F (175°C).
Line a 12-cup muffin pan with paper liners.
For the crumble, combine flour, brown sugar, cinnamon, and salt in a small bowl.
Add melted butter and mix with a fork until coarse crumbs form. Set aside.
In a medium bowl, whisk together flour, baking powder, baking soda, salt, cinnamon, and nutmeg.
In a separate bowl, beat softened butter, brown sugar, and granulated sugar until light and creamy.
Add the eggs one at a time, mixing well after each addition.
Stir in vanilla extract.
Add the dry ingredients in two additions, alternating with the buttermilk.
Mix gently until just combined.
Fold in the finely diced apple.
Divide half of the batter between the cupcake liners.
Add a small spoonful of cooled apple filling to the center of each cupcake.
Cover with the remaining batter.
Sprinkle the crumble topping over each cupcake.
Bake for 20–25 minutes, or until the cake portion is baked through and lightly golden.
Cool in the pan for 5 minutes, then transfer to a wire rack.
For the optional glaze, whisk powdered sugar, milk, and vanilla until smooth.
Drizzle over completely cooled cupcakes before serving.