I always trust the rangers advice about bears.
I comment on this as a National Park Service retiree, with a 40+ year career in the parks. Use a bit of discretion, even when dealing with advice from a ranger. Don't take anyone's advice uncritically, just because they happen to bein uniform.
Ideally, you are talking to a competent, knowledgeable old hand who has current, up to date experience and a vast store of knowledge.
You might also be conversing with a new, wet-behind-the-ears punk who hasn't a clue, and hasn't even found the restrooms yet(universally the subject of the most frequent question in any park).