Currently, you have your variable defined below the include which would be too late. If you defined the variable above the include it should be accessible by whatever file is included.
$hssHeading = "A new different Title";
include( locate_template( 'cp/heroSectionSmall.php', false, false ) );
<!-- heroSectionSmall.php -->
echo $hssHeading;
Maybe a better solution though is to simple create a function or call an action to output this heading which will allow you to modify it with conditionals or hooks:
<h1><?php the_hssHeading( $hssHeading ); ?></h1>
<!-- functions.php -->
/**
* Display HSS Heading
*
* @param String $current_heading
*
* @return void
*/
if( ! function_exists( 'the_hssHeading' ) ) {
function the_hssHeading( $current_heading ) {
echo $current_heading . ' | Foobar';
}
}
Or via filter hook:
echo apply_filters( 'theme_hss_heading', $hssHeading );
<!-- functions.php -->
/**
* Modify the HSS Heading
*
* @param String $current_heading
*
* @return void
*/
function hssheading_modifications( $current_heading ) {
return sprintf( '<h1 class="%1$s">%2$s</h1>', 'foobar', $current_heading );
}
By using a filter hook or function you’ll open yourself up to customizing this section all in one place. Additionally you allow child themes to modify or override this functionality pretty easily.