Magento 2.4.2: Overriding Carrier.php of Magento Fedex module doesn’t work

I got to override Carrier.php in Magento-fedex module which is seen in the screenshot below.

enter image description here

The structure of the overriden Fedex module under app/code in the project is as below.

enter image description here

registration.php, modul.xml are all edited accordingly. Also ran the upgrade commands. The change doesn’t seem to have taken place. Am I overriding the module the way it should be?