Do you mean african CLAWED frogs or african DWARF frogs?
There is a HUGE difference.
African CLAWED frogs get WAY to big to be kept in a 12gallon. Especially 2. They need 10-15g PER frog.
Not to mention they grow much faster then goldfish and will eat any goldie that will fit in it's mouth. Not a good thing. They grow to 10 inches and live for 30yrs. Yes that's right 30yrs!!!
They are also very sensitive to vibration and current. They should not be kept with strong filters. They need plenty of places to hide and the water should be no deeper then 12 inches and kept at at least 70 degrees. They are also aggresive and may attack your fish as they get older.
African DWARF frogs are just fine in a 12g.

No they cannot be medicated. You must remove the frogs or they will die. Just pop them into another container of at least a 2g capacity and keep a lid on them while you medicate. Once all the meds are removed with carbon, reacclimate the frogs and you are good to go!
If they are CLAWED you need another tank or they're gonna die anyway. Or your fish are.
A 20g long will do if you do A LOT of water changes. Good luck.