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!!
When it's all clean /new and dry apply either a grout sealer or stone sealer onto the grout.
It'll really help the grout clean up in future.
Good luck