Custom shortcode for displaying user based on a role parameter

First, you’ll have to get shortcode parameter(s). Change function’s declaration to:

function display_user_roles( $atts ) {

Your shortcode will be either [hw_display_users] or [hw_display_users role="roletopass"]. The first (no parameter) will use role specified in $args array. Second will replace $args->role with parameter passed. Add

if ( !empty( $atts['role'] ) )
    $args['role'] = $atts['role'];

before

$users = get_users( $args );

Remaining code should be ok.

For more information how to handle shortcodes with parameters read this.