Localize script not working

You’re calling wp_localize_script before the action that enqueues the script has run. Move the localize into the enqueue action, after the script is enqueued.

function my_scripts_method() {
    wp_enqueue_script(
        'ajax_script',
        get_stylesheet_directory_uri() . '/js/ajax_script.js',
        array( 'jquery' )
    );
    wp_localize_script('ajax_script', 'WPURLS', array( 'siteurl' => get_option('siteurl') ));
}
add_action( 'wp_enqueue_scripts', 'my_scripts_method' );

That said, you probably don’t want to be directing requests directly to template files, as you won’t have access to any of the WordPress API that way. Instead, direct requests to admin_url('admin-ajax.php'), and read up on using AJAX in Plugins.