Low stats do not mean low participation.
Just because a character does not have high numbers in a particular stat does not mean they cannot participate in any particular encounter. As someone who's played a 5e bard, the fact that you and your player think they're worthless in combat is baffling to me. Why are they only shooting a crossbow when they're arguably one of the most versatile casters in the game?
Likewise, just because your barbarian has low CHA and INT doesn't mean they can't interact with NPCs. I've seen (and played) characters who were obnoxious, dumb oafs that nevertheless manage to engage in entertaining social interactions. A low CHA does not mean that you're shy--it just means you might be bad at lying, for example.
Ultimately, a character is more than their character sheet--they (ideally) have personalities, motivations, and preferences beyond their specific stats. In fact, it's sometimes more fun to have characters that are really bad at things they like to do, like a talkative CHA 6 character.
Explain this to your players.
Your players need to understand that they do not need to be slotted into specific gameplay niches. Most social interactions, for instance, don't actually require rolling checks--your barbarian can still talk to bartenders and ask for information. Likewise, almost every class has something useful to do in combat! Because you say that your players are willing to play both combat and RP, you should emphasize to your players that their gameplay is not fully determined by their stats. Instead of asking themselves, "Who has the best stats to engage in this interaction?" they should be asking, "What would my character be doing in this situation?"
This problem is also partially due to the players' self-imposed limitations. For example, if the bard doesn't have damaging spells, then they're throwing that part of their class away. How would you react to a fighter that refused to use a weapon? Hence, you need your players to accept that they should build characters that are useful in your campaign. When I played a bard, the only damaging spells I really used were Vicious Mockery, Dissonant Whispers, and Fireball--the rest were utility spells, and it worked well.
Create situations where character abilities are relevant.
Once you have buy-in from your players, you should build scenarios and encounters where players' abilities are relevant.
For social encounters, you can build in checks that are not CHA based. PHB 175 describes this variant:
Normally, your proficiency in a skill applies only to a specific kind of ability check... In some situations, though, your proficiency might reasonably apply to a different kind of check.
Therefore, your barbarian might be able to roll a Strength(intimidation) check to intimidate an NPC with a feat of strength, or a Constitution(performance) check to win a drinking game.
On the combat side, you can introduce intelligent enemies that will negotiate with the PCs during a combat. I've played and run a number of encounters that were half combat and half conversation--the skill monkey could play tricks that cause goblins to run away in fear, for example.
You'll have to be careful not to overuse these "crossover" tricks, lest you devalue the other side, but they're a useful tool to allow talkers to participate in combat and combatants to participate in talking.
The first step is to ask your player if she still wants to be in the campaign
Tell her to be honest with you; but it is important to not attribute motive to her. She might be being reckless because of disinterest in the campaign, or there might be group-dynamics issues, or even problems that exist outside of the group that are influencing her behavior.
As someone who has been on the receiving end of this situation, I think it is important not to assume your player wants to leave the campaign but to ask first; assuming her motive will likely make her think you are trying to get rid of her and also may hurt any friendship you have with her outside of the context of the game as well; I certainly would have thought that my GM didn't want me around if she had just approached me asking how I wanted to leave the game when I was just suffering the side-effects of depression.
This is the best suggestion I can give.
Best Answer
It sounds like your DM is playing favorites
As much as I hate to accuse anyone of favoritism, the way you've posed the question makes it sound like your DM is playing favorites in the party. That's never fun for the players stuck on the outside.
I've written about dealing with feeling left out in a party before and I think a lot of the advice I had there applies here as well. For background, I DM for a small group and was unintentionally favoring one player over another. She pointed out the issue and I made a real effort to correct my behavior. The following is extrapolated from what worked for our group.
Talk to your DM about your concerns
The first place to bring this up is going to be with your DM. Have a private, one-on-one meeting outside of your normal gaming time. You want to prevent putting the DM on the spot as that just tends to make people defensive.
Lay out your concerns in a non-accusatory manner. Sure, it's entirely possible that your DM is intentionally favoring these two players, but you want to give them the benefit of the doubt so you don't burn any bridges. It's possible they don't realize, like I didn't, that their actions aren't making the game fun for everyone.
You mentioned in comments that you weren't sure if the DM had ever DM'd before. New DMs can - and will - make a lot of mistakes, and sometimes just pointing out the issue will correct the behavior.
I would particularly bring up the party splitting. Although it's mechanically possible in D&D, it's not great for party dynamics, as you've clearly experienced. In general in my games I try to keep splits geographically small and for limited durations of time. The most I'll allow my party to split is to let them run mundane errands alone (B goes to the armorer to sell armor, C goes to the general store to buy rope, and I narrate in a B - C - B - C pattern) or investigate separate rooms in a house/dungeon alone (B takes the left-hand room, C the right). Any longer and you end up with players sitting around bored while other people have all the fun, which is no good.
If your DM seems receptive to your complaints then you have a good chance of this group working out for you. The next step once they agree that there's a problem is to talk to the rest of the group as a whole and all get on the same page. I'll talk about that later in this answer.
If, however, your DM doesn't see the problem with their session structuring and their own behavior, you might be out of luck, which is where my next point comes in.
Talk to the other party members
It might help to check in and see how everyone else in the party feels. It sounds from your comments like there's a core group of about five of you, including the two favored players.
I would talk to all the players, not with the DM there, and see if they also feel like some players are being favored over others. Similar to talking to your DM, make sure this isn't accusatory. The idea isn't to blame the favored guys, but just to see if everyone feels the same imbalance you do, and most importantly, see if everyone's having fun.
You may want to speak with just the non-favored players as presumably the favored ones are having fun. I would caution against having the talk devolve into DM-bashing, but it might give you a chance to see if they're willing to stand with you about being treated un-equally.
If you're the only one not having fun then you might need to either deal with it (not great) or leave the game (also not great). However, you may find that you're not the only frustrated one.
If multiple people agree with you that's good evidence to bring to your DM. Maybe you need to start a new campaign with everyone on the level, or maybe you even need to find a different DM and those of you who aren't happy can start your own game.
If the group's going to work out
If you've talked to your DM and the other players and everyone agrees there's a problem and wants to fix it, this is a great time to try the same page tool during a Session 0.
Basically, have an interlude session where you can all make sure you're playing the game for the same reasons and establish some boundaries such as Don't Split The Party. You can then start over with a blank slate and hopefully have a much better game.
If the group isn't going to work out
If instead the DM didn't see any issues with the current setup and some of the players were totally happy with the game you have three options.
Option One: Stay
If everyone else is happy with the current setup, you could stay with them.
I would recommend this one the least, to be honest. Unsurprisingly, it's not fun to stay in a group where you aren't having fun. But if you really want to play, can't find or start another group and are willing to put up with the behavior this is technically an option.
Option Two: Leave
If one or two people expressed dissatisfaction but nothing is changing, leave.
There's no sense staying in an activity you aren't enjoying. However, that doesn't mean you have to stop playing! Maybe there's another group you can join with a friend or two, or an Adventurers League you can join.
Option Three: Start your own game
If several people aren't happy with the game, you can always start your own!
If you don't have someone immediately willing to be the DM there are plenty of groups that do rotating DMs so no one person has to be the DM all of the time. Start your own group and play D&D the way you want to play it. You can always schedule it at a different time than the other game so players can be in both if they want to.
In Conclusion
Not every group is going to be a good fit for you as a player. It's okay to leave if you aren't having fun, but I would encourage you to talk to your DM and other players first. It's totally possible that this group is salvageable with a little legwork and patience. Either way, don't get discouraged from playing D&D and other tabletop RPGs!
Additional food for thought
Knowing that your DM is a teacher in your school and still seems to be favoring specific players, I'd like to offer the following personal experience.
When I was somewhere in the 11-12 range I joined an after school board game group at my school that was run/hosted by one of the 6th grade teachers. The participants were mostly a mix of misfits looking for an after school activity to keep them occupied, and then there was "Neal". Neal was a huge troublemaker in class and constantly getting scolded for behavior and academic shortcomings. He was loud, jittery and had trouble keeping his attention and his limbs to himself. He got pulled out of class a lot for academic help and didn't have any friends.
In the game group his behavior wasn't much better; he talked over people and had trouble remembering when it was his turn. The teacher didn't do more than the bare minimum to rein him in; Neal often got first pick of games and I even remember him turning a blind eye to Neal accidentally cheating now and again.
I remember going home to my mom and complaining that Neal was getting unfair treatment. My mom wisely pointed out that Neal was having a hard time socially, and that this game group sounded like somewhere he could have fun and be included in things. She cautioned me that maybe the game group was the only place he could fit in and that I should try to be more welcoming.
Obviously I know nothing about the favored players in your group, but there's a chance this might be a similar situation and the teacher is intentionally favoring those kids to give them a positive social experience. It might be worth thinking about when you broach this topic with your DM and the other players.