I see. But what if i separate the circuits wth an switch or something when charging?
If it's ok to charge just one battery at a time, that would be possible. You would need to use a double pole double throw switch, as you would need to switch both 5V and GND lines between the inputs of the two TP4056 modules.