Yes, Yellowstone is huge (I remember reading it's bigger than either NJ or RI?), but I don't remember any hiking trails to get away from the crowds that actually excited me, other than perhaps to avoid the crowds. All of the crowds are going there to see Old Faithful, the other geysers, the geothermal activity, waterfalls, mud pits, bison, wolves from a distance if you're lucky, etc. Sure you could just walk off on a trail, but I don't know of any trails that would actually be worth it, esp. with a 5-year-old.
Tetons definitely has more hiking, but the hike I did with my family (forgot the name, took a boat to the trailhead) was mobbed. Paintbrush Canyon looks phenomenal, but it's a 2-day backpacking loop, not for a toddler.
As I said, Glacier is amazing and superior in my opinion, but you have to decide if you'd rather scratch the surface of it (which is still amazing), or doing Yellowstone and Tetons properly, which is still amazing, and then go back to Glacier when you can see it more fully. If you do go to Glacier, there are family-friendly activities, such as boat tours and kayak rentals on a few of the lakes, whitewater rafting on a river just out of the park (don't know min. age for it), driving to the Canadian side (don't forget passport), and some nice shorter hikes, plus almost guaranteed wildlife sightings. You can't go wrong either way.