Find the page template of the previous page

You can use wp_get_referer(); to get a URL of previous page from where user came. Then get the last slug part of the URL. Then compare if the slug matches with slug of your custom search-result page template. Then you can decide whether to show or not to show ‘Back to search results’ link. Please try below code and feel free to update as intended:

<?php 

    $ref_url = wp_get_referer();

    $results = explode("https://wordpress.stackexchange.com/", trim($ref_url,"https://wordpress.stackexchange.com/"));

    if(count($results) > 0){
        //get the last record
        $last_word = $results[count($results) - 1];
    }

    if ( $last_word == "about" )
        echo "<a href="https://wordpress.stackexchange.com/questions/212927/$ref_url">Back to search results</a>";

?>