Morocco moved past former Euro champions Portugal and record World Cup winners Brazil to achieve its best FIFA ranking.