Good afternoon,
Yes, you can just rake out the stained areas although, do note that the new grout will then look different in shade.
You'll probably find you need to take out a least 5/6mm depth to get the new grout to stick into the joint.
Careful you don't damage a tile, go carefully...