If you look at the rest of the game, it's a tough step for the Sheriff. If they want to qualify they have to fight extra hard. Indeed, on paper Madrid and Inter are very superior, but in football anything can happen. So maybe we can see the determination of qualifying in the final group match.
The Sheriff's problem is that Real and Inter are stronger not on paper but on the field. Now in Group D a situation arose that the matches began to matter as if it were a playoff stage, and immediately the results became less random. I am sure that Sheriff will lose the next matches with Inter and Real with a big score (at least with a comfortable score for Real and Inter).
Football games do not take place on paper. I'm sure you never counted Sheriff from the start, but they went on to beat Real Madrid and Shakhtar Donestk and collected 6 points in a well-deserved victory. They may lack the resources and calibre of players that Shakhtar Donestk and Real Madrid have, but as long as they are technically coached, they will beat them again in the return leg.