Preheat the oven to 350°F and grease a 9×13-inch cake pan with butter and line with parchment paper, letting the paper come up over the edge for easy removal. In a large bowl, whisk together the sugar, flour, cocoa powder, baking soda, baking powder, espresso powder, and salt. Set aside.
In a large bowl or stand mixer fitted with a paddle attachment, cream the butters together and scrape down the sides of the bowl. Add the powdered sugar one cup at a time, alternating with tablespoons of heavy cream. Add in the vanilla and whip on medium-high speed for 2 to 3 minutes until the frosting is light and fluffy.
Bring the heavy cream to a simmer in a small saucepan then pour over the chopped chocolate in a heat-safe bowl and let sit for 5 minutes. Add the vanilla and whisk together until a rich and smooth ganache forms. Allow it to cool for about 20 minutes before pouring it over the top of the mounds of frosting. Add sprinkles if desired and let the ganache cool completely before slicing and serving.