Locked/Unlocked in title

Your function will never “get” $post as this is not how functions work. Functions cannot pull anything into itself by itself. If you have debug turned on, you will get a definite bug notice that $post in undefined…..

You would need to invoke the $post global inside your function for anything to work that relies on the $post global, so the following would work

function unlocked() {
  global $post;

  if(!empty($post->post_password) && !post_password_required()) {
    echo 'unlocked icon reminding them this was protected and they put in their password already';
  }
}