All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
If what you meant is that you [as a girl] and your brother pray behind an Imaam, then it is better for you to be behind your brother. But if you place your prayer mat next to your brother’s in the same row, the prayer of both of you is valid, even if there is no gap between you and your brother, and even if this is contrary to what is more appropriate.
An-Nawawi said in Al-Majmoo’:
"If men, boys, hermaphrodites and women attend, then men would be first, then boys, then hermaphrodites, and then women. Our companions (i.e. the scholars of our School) said: 'All this is desirable, and acting contrarily to this is disliked, but it does not invalidate the prayer.'"
Allah Knows best.