It doesn't mean that because Mary's cousin was a Levite and that makes Jesus can't come from the tribe of Juda. We are not to question the authority of the Bible. The generations of Jesus was written in the book Matthew.
Matthew 1:2 Abraham begat Isaac; and Isaac begat Jacob; and Jacob begat Judas and his brethren;
Matthew 1:3 And Judas begat Phares and Zara of Thamar; and Phares begat Esrom; and Esrom begat Aram;
Matthew 1:4 And Aram begat Aminadab; and Aminadab begat Naasson; and Naasson begat Salmon;
Matthew 1:5 And Salmon begat Booz of Rachab; and Booz begat Obed of Ruth; and Obed begat Jesse;
Matthew 1:6 And Jesse begat David the king; and David the king begat Solomon of her that had been the wife of Urias;
Matthew 1:7 And Solomon begat Roboam; and Roboam begat Abia; and Abia begat Asa;
Matthew 1:8 And Asa begat Josaphat; and Josaphat begat Joram; and Joram begat Ozias;
Matthew 1:9 And Ozias begat Joatham; and Joatham begat Achaz; and Achaz begat Ezekias;
Matthew 1:10 And Ezekias begat Manasses; and Manasses begat Amon; and Amon begat Josias;
Matthew 1:11 And Josias begat Jechonias and his brethren, about the time they were carried away to Babylon:
Matthew 1:12 And after they were brought to Babylon, Jechonias begat Salathiel; and Salathiel begat Zorobabel;
Matthew 1:13 And Zorobabel begat Abiud; and Abiud begat Eliakim; and Eliakim begat Azor;
Matthew 1:14 And Azor begat Sadoc; and Sadoc begat Achim; and Achim begat Eliud;
Matthew 1:15 And Eliud begat Eleazar; and Eleazar begat Matthan; and Matthan begat Jacob;
Matthew 1:16 And Jacob begat Joseph the husband of Mary, of whom was born Jesus, who is called Christ.