I have this texture from a game that I'm trying to mod and i was wondering if it's possible to remove the baked shadow on the pants using compositor or another method on blender
It's somewhat impossible. At least without additional data like the environment in which the texture was baked - then you could bake shadows alone and remove that. Also keep in mind that a lot of the detail you want to preserve is also shadows - unless you have recreated all the little details like buttons and pocket irregularities - but then you actually can try the suggestion in the 2nd sentence of this paragraph.
You can use something like High Pass filter in Photoshop to detect edges. Keep in mind if you have a shadow of a stripe like the two stripes here:
Then you will get edges between bright and dark areas, that I imagine weren't there on the original texture. Also, blurring the underlying image before reapplying the high frequency detail will remove a lot of information that you probably want to keep.
Here's a node setup I tried:
(I used Shader Editor, but similar principle could be achieved in the Compositor)
You can get better results, but not a lot better, I imagine. At least not without some AI algorithms.