Without more info, I don't think you can say there is a right and a wrong answer. For example, if they trespassed totally by accident and were blind-sided by the bear for no particular reason, then the sanctuary and rangers would probably be liable for the damages of the attack, and the rangers would be smart to shoot the bear before it could inflict much injury.
On the other hand, if the tresspassers were poachers, were sneaking up on a baby cub to shoot it or something, and mama bear surprised the poacher and reacted instinctively to protect her young, then I doubt that the rangers would be required to shoot the bear that they are there to protect.
The "right" answer would probably come down to a matter of the applicable laws. Try researching the laws regarding game sanctuaries (in the country where you are -- they probably are different in Africa versus Canada versus the US), and see if there are some clues there.