You're not wrong to think about this but it's ultimately hard to know and would depend on a lot of details. What material exactly are you recycling, how is it collected, what machines does your municipality have, where does the electricity come from, etc. You'd have to spend a lot of time figuring this out and then reading up on the science. As someone who works in a related field I can tell you that even people who study this often aren't in agreement about the effects of recycling.
And more importantly: People tend to get lost in minute details when it comes to doing something against climate change. Get a fuel efficient vehicle for your next car, or better yet ride a bike. Get solar panels installed on your roof if that's an option. If you have a garden grow some vegetables. Depending on what you get they barely need much work except for watering.
Most of the fossil carbon that goes into the atmosphere because of you comes down to your electricity use, heating, transportation, food and other consumption. Try to cut down on that where sensible and possible, don't worry too much about yogurt cups. If you're serious about it stop buying them, go vegan. But if you do buy them it likely doesn't make much of a difference. You can assume your local government has looked into it and in most cases isn't going to do something totally stupid. What many don't know is a lot of the plastic can't get recycled anyway so even though they collect it as "recycling" it later gets sorted out and burned (or dumped on a landfill in less developed countries). So just throw it in there anyway if you're unsure, unless your local authorities tell you otherwise. Where I live there's a website with instructions on how to sort the trash.