1. Ghana 4 points (2:1)
2. Germany 3 points (4:1)
3. Serbia 3 points (1:1)
4. Australia 1 point (1:5)
As Red pointed out, it's the goal difference that counts, not H2H.
So these are the scenarios for all 4 teams, how can they qualify (no matter if 1st or 2nd)
Ghana qualifies if:
- They don't lose against Germany
- They lose by a small margin and Australia beats Serbia by a small margin.
- They lose by 1 goal margin, Australia-Serbia ends with a draw, and Ghana scores against Germany as many goals as Australia and Serbia will score in their draw.
Germany qualifies if:
- They win
- They draw and Australia-Serbia draw
- They draw and Australia beat Serbia, but not by 7 goals difference

D)
Serbia qualifies if:
- They win
- They draw and Ghana beats Germany
- They draw and Germany beats Ghana by 2 or more goals
- They draw and Germany beats Ghana by 1 goal difference, but only if Serbia score in their draw with Australia 2 more goals than what Ghana will score in their defeat to Germany
Australia qualifies if:
- ....It's almost impossible

They have to beat Serbia 3:0 and Germany to beat Ghana 2:0. Or if Australia win 2:0 then Germany has to win 3:0. If Australia wins 1:0 then Germany has to win 5:0.