Rather than creating a third instance, use the version of .begin() that lets you set the address. Something like this should work:
#include <Adafruit_INA219.h>
const byte A_addr = 0x40; // address of sensor A (known)
const byte B_addr = 0x41; // address of sensor B (known)
Adafruit_INA219 ina;
byte C_addr = 0; // address of the connected INA sensor (unknown at this stage)
void setup() {
// read bus voltage from first sensor
ina.begin(A_addr);
float A_voltage = ina.getBusVoltage_V();
// read bus voltage from second sensor
ina.begin(B_addr);
float B_voltage = ina.getBusVoltage_V();
// assign address of connected sensor to S_addr (range and error checking removed)
if (A_Voltage > B_Voltage) {
C_addr = A_addr;
}
else {
C_addr = B_addr;
}
// Switch to the desired device
ina.begin(C_addr);
// now we have C_addr, but how to instantiate ina_C(C_addr) to make it accessible in loop()?
}