You asked:
I would like to hide the headline outside the loop
I assumed $download_headline was therefore outputting the headline.
As such, the code solution I gave did exactly that!
Given the code provided, this gets the user role of the logged in person – this much I believe would be required to ensure your initial code works.
You can therefore wrap your file inside the loop with the same conditional:
if( array_intersect($author_roles, $user->roles ) ) :
//YOUR FILE
endif;