Preheat the oven to 350 degrees F and line 2 standard 12-cup cupcake tins with liners.
For the cupcakes: Add the flour, granulated sugar, brown sugar, cocoa, baking soda, salt and baking powder to the bowl of a stand mixer fitted with the paddle attachment. Mix on low for 1 minute to combine.
In a large bowl or liquid measuring cup, whisk together the oil, buttermilk, eggs, food coloring, vanilla and vinegar. Add to the dry ingredients and mix on low to combine. Scrape the bowl with a rubber spatula. Raise the mixer speed to medium and mix for 2 minutes. Scrape the bowl then mix on low for 1 minute.
Use a 1/4-cup scoop to fill each cupcake liner two-thirds of the way full. (If any batter is leftover, bake in a second batch.) Bake until a toothpick inserted into the center of a cupcake comes out with moist crumbs attached, 20 to 22 minutes. Cool the cupcakes in the pans for 5 minutes before removing to a wire rack to cool completely. Store unfrosted cupcakes covered, at room temperature for up to 2 days.
For the cream cheese frosting: Beat the butter in the bowl of a stand mixer fitted with the paddle attachment on medium speed until smooth and satiny, about 2 minutes. Scrape the bowl and paddle with a rubber spatula. Add the cream cheese and mix on low to combine. Raise the speed to medium and beat until smooth, about 1 minute.
Add the vanilla, salt and half the confectioners' sugar and beat on low until you no longer see any sugar. Add the remaining sugar and blend on low to combine. Scrape the bowl and paddle well. Increase the mixer to medium speed and beat until the frosting is smooth and lightened, about 1 minute. Test the consistency of the frosting by lifting a small portion out of the bowl with a rubber spatula: if it holds its shape and doesn’t drip off the spatula, it is ready. If it is loose and doesn’t hold its shape, place the frosting in the refrigerator for 20 to 30 minutes.
Transfer half of the frosting to a small bowl and use gel food coloring to tint blue. Transfer half of the remaining frosting to a separate small bowl and use gel food coloring to tint red. Place the blue, red and white frostings in separate piping bags fitted with large, open star tips. Decorate half of the cupcakes with the blue frosting and sprinkle with the white star sprinkles if using. Decorate the remaining cupcakes with three layers of alternating red and white stripes.
Enjoy the frosting on cupcakes the day that they are frosted or store any leftovers covered in the refrigerator for up to 3 days.