First I would find out if both are actually bad. The classic Prius is somewhat known for throwing a bunch of spurious "Red Herring" codes when either of the 2 (HV or 12V Aux) batteries goes bad. Please update the question with the reported DTCs. For example the DTCs P3000 and P3006 mean that the HV battery has shorted a cell. P3009 means that there is a voltage leak to ground somewhere in the otherwise floating HV system. It can be anything from dust/corrosion buildup in the HV battery all the way up to a grounded winding in either of the 2 MGs in the transaxle.
classic.artsautomotive.com