This is what I do:
I always have extra carry-bags to keep the trash in.
Depending upon what my plan is, if I am coming around the same way back home, I usually pickup everything which shouldn't be out there and place the bag at location where it will not be easily found by people or by animals.
On my way back home, when I know I don't have an extra bag to carry, I can pickup small non-biodegradable things like, very commonly: plastic wrappers, tetra-packs and similar stuff that I can carry without a trouble, and stuff it somewhere in the side of the haversack. So I can carry everything I brought with me, and that I collected as garbage during the trek.
And, I insist on suggesting other fellows to do the same if they can and care about environment.
Now this is specific to my place. In India, carrying liquor in any form during a trek/hike or in a National Park is a serious trouble if caught by authorities.
So, I would never want to be getting in trouble if I am carrying an empty Beer can or a vodka bottle some stupid fellow didn't bother to bring back and trash where it is supposed to be trashed. In such a case, when I notice that a particular route needs cleaning, I take pictures, reach out to people, friends and we together plan a clean-up activity with permission and support from villagers, That goes onto a different level altogether when it really matters.