The correct option is (d) walked up on.
"The inspector walked up on the group sitting behind the shed and took them by surprise."
"Walked up on" means to approach someone suddenly/unnoticed, making it the correct phrasal verb here. "Walked up" (without 'on') lacks the sense of surprising someone; "walked away" means to leave; "walked into" means to enter a place, not to approach a group stealthily.