I'm baking cupcakes and the recipe calls for espresso but I was wondering if I could substitute decaf coffee instead since it's for children.
Yes, probably. I've substituted decaf coffee in a number of recipes that called for regular coffee or espresso, particularly when it might be served to kids. (And frankly, also for myself, because I don't like to consume caffeine late in the day anymore either.)
Some substitution guides will tell you to brew the coffee a little stronger than usual, which might imitate the stronger flavor of espresso. The problem with that is twofold: (1) the high-pressure espresso extraction process highlights different flavor components compared to just a normal strongly brewed coffee, and (2) decaf coffee often has unbalanced notes to begin with, given the processing necessary to remove the caffeine. By brewing it stronger, you risk bringing out the unpleasant "stereotypical decaf coffee" flavors even more.
Of course, in many recipes the amount of coffee is minimal, so this may not matter. But unless you're certain your decaf coffee is pleasant when brewed strong and will complement the other flavors in the recipe, I might just brew it as usual, rather than trying to "amp it up" to make it more like espresso.