How to pass a variable from a template page to the child theme functions.php

… from a custom WordPress page template to my child theme
functions.php file…

You can’t. And a global variable won’t help. The theme’s functions.php file loads first, before any other templates load. You can’t pass variables backwards to something that has already loaded.

What I think you want to do, based on what your code appears to be trying to do, is embed your data in the template file:

wp_enqueue_script( 'extra js', get_stylesheet_directory_uri() . '/js/extra.js' );

$datatoBePassed = array(
  'hvuri'  => get_stylesheet_directory_uri() . '/page-homevalue.php',
  'latitude' => __(latitude), 
  'longitude' => __(longitude)
wp_localize_script( 'extra js', 'gmap_php_vars', $datatoBePassed );

Then have your Javascript look for that data via the gmap_php_vars Javascript variable.

Proof of concept:

function grab_gmap() { ?>
  <script type="text/javascript">

In effect you are doing more or less the opposite of what you are trying to do.

In practice, you should not really shove Javascript into the page like that. The function responsible should probably be in the extra.js file you enqueue.