Change menu based on page template via functions.php

The $args the filter is receiving includes the theme_location used when the menu was registered, so assuming your main location is primary, you can add the following to your if statement to target only that menu:

    if ( 
      is_page_template( 'page-template-custom.php' ) && 
      isset( $args['theme_location'] ) &&
      'primary' === $args['theme_location'] )
    ) { ...

See:
https://developer.wordpress.org/reference/hooks/wp_nav_menu_args/
and
https://developer.wordpress.org/reference/functions/register_nav_menu/
for reference