It depends -
Data stored in volatile memory RAM - will be lost once the power is disconnected -
if it is backed up by storage capacitors, then when they are depleted the data will be lost (15- 30 mins approx)
if its in non volatile RAM, then its there permanently ( as its written in such a way it cant be lost)
Also certain data, (mileage) is also sent to various ECU's on the BUS to provide backup incase of tampering --
Say you want to roll 10k off the mileage and fit a kombi with lower miles - the CAS ECU will see the discrepancy and show an error on the Kombi ,
as its expecting to see the same miles in the data sent from the CAS ECU.