The subject of 1 Corinthians 14:1-25 is about prophecy and tongues, not speaking in general. Vs. 26-40 is about orderly worship. Paul is giving a number of regulations for the proper use of the gift of tongues.
When we go back and read 1 Corinthians 11:2-16 Paul gave rules for women praying and prophesying in the church, and also rules for the men about covering their heads so this shows that women were allowed to give prophecy and also speak in tongues for the purpose of edifying the body of Christ and also giving God's revelations to the body of Christ
Many have been taught that only a man is allowed to exercise the gifts of tongues and to give prophecy in the church, but we can clearly see by those verses that God also uses women to to exercise the gifts of the Holy Spirit. Also, according to 1 Corinthians 12 it only states that the Holy Spirit gives these gifts to those who make up the body of Christ (church), not just men only, and to possess with sincere and intense conviction, or in other words to take these gifts seriously.
1 Co 12:28 And God hath set some in the church, first apostles, secondarily prophets, thirdly teachers, after that miracles, then gifts of healings, helps, governments, diversities of tongues.
1Co 12:29 Are all apostles? are all prophets? are all teachers? are all workers of miracles?
1Co 12:30 Have all the gifts of healing? do all speak with tongues? do all interpret?
1Co 12:31 But covet earnestly the best gifts: and yet shew I unto you a more excellent way.
I do need to add that there is a difference between speaking in tongues as that is for the edification of the Church body and speaking words of prophecy are revelations of God spoken for the Church body.
Now let's go read 1 Corinthians 14:33-34 that is about orderly worship. Man and brethern is just a masculine term, but also includes women as both are made in the image of God.
So God created man in his own image, in the image of God created he him; male and female created he them" (Genesis 1:27).
Male and female created he them; and blessed them, and called their name Adam, in the day when they were created" (Genesis 5:2).
It is interesting to note that God called both male and female, "Adam" in the day they were created. Adam means "man." Adam and Eve were created with God-ordained differences from each other, but together they made a full "man," or a complete picture of God Himself. There was perfection in their union. Their differences were not a source of discord or inequality, but a beautiful compliment to each other. Together, God gave them the task of overseeing His creation.
Back to 1 Corinthians 14:26-40 that is about orderly worship as I want to point out vs. 33-35.
1Co 14:33 For God is not the author of confusion, but of peace, as in all churches of the saints.
1Co 14:34 Let your women keep silence in the churches: for it is not permitted unto them to speak; but they are commanded to be under obedience, as also saith the law.
1Co 14:35 And if they will learn any thing, let them ask their husbands at home: for it is a shame for women to speak in the church.
Why would Paul say that God is not the author of confusion. I'm not seeing Paul saying a women is not to speak in tongues or to give prophecy, as all of this comes by the Holy Spirit working through whom He chooses as even I have done both as well as many women, but that there was no orderly fashion within these women as they were becoming confusing being out of order probably all trying to speak at the same time. I also see many women in the Corinth Church asking many questions during the service and being told to hold their questions till they got home and to ask their husbands these questions they had.