I don't think you want to escape that text, plus the quoting seems wrong. No guarantees, but I'd try:
printf(
'Tracking number: <a href="https://www.fedex.com/fedextrack/?trknbr=%2$s">%2$s</a>'),
esc_html($shipping_carrier),
esc_html($ups_trackingno)
);
(Escaping the link text would convert things like <
to <
, causing it to not be treated as an HTML tag by the browser.)