I'm a fan of both.
B5 is better sci-fi. It's told as one long cohesive story, so it has a lot of time to explore ideas and themes. It is, however...very cheesy. A lot of the VFX don't hold up, the first season feels like dime store Star Trek before the actors found their characters and the plot kicks into gear, and the fifth season is almost entirely epilogue. But. It's a show you should watch.
Star Trek is very often better television. There's more Trek to be had, and it's easy to find your home in the franchise. Production quality is usually better. It's slightly harder sci-fi, there's usually less hibbity jibbity in it. Star Trek is a lot worse at following an overall story arc, DS9 is the best at it, TOS and TNG were aired before overall stories were invented, VOY infamously failed to implement the story they told us it had, ENT decided fuck it we're Starship Troopers now, and that's the canonical end of the Star Trek franchise.