Preparing for battle
Get your Pokemon to level 13 at least, Brock's Geodude is level 12 and his Onix level 14. If you have the extra time, try to get your Pokemon to level 15+. If you have Pokemon with no attacking moves, put it at the head of your party, when you get into a battle switch it out for a Pokemon that has attacking moves. Keep doing this until the Pokemon with no attacking moves levels up and gets an attacking move. The process can be very time consuming, but you need attacking moves. make sure you have special attacking moves, his Pokemon have low Sp. Defense. If you want more coverage, get a Pokemon that is not weak to Rock or Ground types or that has moves that are super effective on Rock and Ground type Pokemon (Water, Grass, Ice, Fighting, Ice, and Ground)
Pidgey
Give Pidgey Quick Attack (it learns it on level 12). When you use Quick attack it will always go first. If you want to be really annoying for Brock, use sand attack two or three times on his Pokemon, when their accuracy is very low it will be very hard for them to land a hit on your Pokemon.
Charmander
Make sure your Charmander has ember, it is a special attacking move. Both Brock's Geodude and Onix have low Special Defense. If you want to have your Charmander be a bit more protected from Brock's Pokemon, use Growl, it will lower the Pokemon you use it on Attack. For Onix, use Leer, it has a high defense, use leer to lower Onix's defense.
Nidoran
My only tip for Nidoran is to NEVER EVER use poison sting on Brock's Pokemon. Poison sting will do 1/4 damage on his Pokemon.
Defeating Geodude
His Geodude will likely raise it's defense because it has Defense Curl, which raises it's defense. Have Charmander lower Geodude's defense using leer, next use Ember on it.
Defeating Onix
Brock's Onix may be a bit tough because it has the move Bide. Make sure you defeat it before Bide lands a hit. If you don't think you will be able to defeat it before it uses bied, use Pidgey and spam sand attack until Onix's accuracy wont go any lower.
Extra tips
Avoid using Normal, Flying, Fire, Rock, and Poison. The only reason I suggested Ember (a fire type move) is because it is the only special attacking move you have currently. If you have another non poison special attacking move, try to use it. Try to avoid using physical attacking moves on Brock's Onix because it has a very high Defense.
Hope I helped!