Yikes, 16 12-year old boys and a castle that will be an adventure. I agree that either would be good. Both are on volcanoes and both have great history connected to them. One thing that I really liked about Stirling was the surrounding geography. You can actually see why the battles were fought over this bit of land that leads to the Highlands. The other thing that Stirling has is the Wallace Monument. It's another impressive tower to climb. You go up a rather tight turnpike stairway to get to the top. Great views of where the Battle of Stirling Bridge took place.
Did you notice on the link that MC gave you that you can buy the tickets in advance online? You might want too look into that as you'll be a bit pressed for time. Also, note that you cannot park at the castle for Edinburgh. The website has info. At Stirling you can park at the Castle. : ) I think that if you are at all concerned about corralling all those boys it would be easier at Stirling, but that will depend on how any adults you have with you to help!
I want to second MC's suggestion that you look on line to see what is happening that day at the castles. You probably won't have to wait until the last minute, and you could probably email Historic Scotland and ask. They really are used to catering to school kids. WhenI was at Stirling there were some great demos of kilts and swords and things and they were definitely involving kids in them whenever they were present.
Pam