It's tough because that's exactly what St Petersburg is pretty much about; palaces, museums etc. You can maybe try to make it interesting by scouting out some things in advance (i.e. what's in the Hermitage & Palaces) and challenging the kids to find them in the museums - bring along small prizes for rewards. For example, choose some of the Faberge Eggs (explain how each one had a special meaning and there was something hidden inside each egg) and let them find them at the Hermitage etc.
Look for things at the Summer Palace like certain paintings - there are so many to choose from, or flowers (the gardens are remarkable) and again, when they find them, a winner. I would *maybe* tell them about the last Tsars - great love story & 5 children.....4 girls and a boy, but avoid telling them what happened to them and avoid letting it be TOLD to them by the guide or anyone else. Not pleasant. The mystery of Anastasia is interesting though.......if you work your way into it creatively........the "missing princess"
The kids may find it interesting that there are so many canals there instead of roads.....gosh, I'm going blank and my friend was just there in May but I don't recall her 2 day tour including a canal ride. Time passed by fast enough with the Summer Palace, Hermitage etc. So making it as a prize worthy scavenger hunt may make it fun for them and then, when they find things, they will be LEARNING too! Great art history lessons and the famed jeweler Peter Carl Faberge who, ironically, did NOT do much of the handiwork on the pieces, I learned, at an exhibit of eggs in another city; one man did most of the work. I was very surprised to see that this one single Russian jeweler/craftmaster had done all of the work by hand on most of the eggs. Mikhail Perkhin - master goldsmith and chief creator of ALL eggs for about 20 years. I was bothered by the fact that he'd done all the work and had none of the credit! But he was mentioned throughout the exhibit at each egg's display. Tell the kids these were started as an Easter tradition, if you are Christian - in not, focus on all the other themed eggs, and continued every year for the Tsarina and her mother, and then later commissioned for many special occasions. The first egg was plain on the outside but inside had a golden yolk, and then finally a mini golden hen with a small ruby set upon her head. Thus began the tradition of the eggs.
As for the paintings, the works of art are from the best in the world - the collection is so vast and rich, full of the masters. Introduce your children to a few of them; choose maybe 2-3 artists and have them try to find paintings by those artists......ask them if they like them or not. If so, what do they like or dislike and why? It is NEVER too early to expose children's minds to the wonderful world of art, so many benefits will come to them from having this knowledge. Nothing blew me away more than being at the Christmas Show, hearing Tchaikovsky's INTRO to the Nutcracker, and hearing a 4 year old say "Mommy, the Nutcracker!" I couldn't believe that with hearing a few bars of the music, she knew what it was!! "Baby Einstein" I was told. But imagine what your children will experience in St Petersburg if you can make it a little fun! Try the prize bag (remember to pick up little things to give out for this part of your trip!!) and make it fun by letting them find artists, discuss etc. Just like with the eggs.
All of this will go so fast you won't believe the time has passed. Their legs will welcome the break riding between places and everything will go well. I think some fun and enjoyment can be had here for everyone.
There are McDonald's in Russia - not sure if in St Petersburg (wasn't looking) but sure in Moscow. Don't know if the tour guide might let you stop etc. They kind of work their itinerary but keep the thought of tip$ in mind too.......so maybe try and ask for and ice cream stop or sweet stop etc. That's always a winner too.
Hope this helps make beautiful St Petersburg something wonderful for the ENTIRE family