I hope you, your grandmother, and your nephew never have to find out for sure. Further, if so I hope your grandmother and two-year-old nephew aren't trying to fire a .500 magnum, especially if it's loaded a bit hot.
Most people in a quick-response situation will be able to handle the bat more accurately than the pistol. There's more you can do with it than a full swing, too, including jabbing at the eyes, throat, or groin with the end of it, strangling with it, tripping, twisting body parts with it as extra leverage in grappling, and short swings which are less powerful but quicker. A bat can take you off your feet pretty quickly, can break the forearm you're using to wield the pistol, and can be pretty damn deadly once you're down.
Inside of arm's reach a pistol can be a disaster as it can be turned on you even while it's in your own hand, by twisting the wrist around. At that range you're probably wielding it with one hand, which make you more easily disarmed and less likely to hit a target that is able to impact you and change where the muzzle points.
If you actually get a good, solid hit with a .38, .380 ACP, or a 9mm from that range, especially with hollow points or JHP then you're doing a lot of damage, sure. With a .45 ACP or .500 magnum even more. Your real advantage, though, with a pistol vs. a bat is that the bat reaches about one meter past the elbow. Use that and stay out of reach of the bat if you're sane.