If you can define what you can considered as "invalid" counter value which is caused by the slave losing power, then you sure can save that last known data into non-volatile memory on the master.
That means you should capture the counter values into a temporary DM memory on the master, and then check how it compares with the previous stored value. If the value seems invalid (e.g. if the slave counter should be increasing and it suddens start from low value near zero, it probably suggest that the slave has been reset) then you need to either discard it or store the new value into a new location. You could even try to restore the last good counter values from the master to the slave using the WRITEMODBUS command. However, you have to decide if this make sense if the slave counter is already in motion and you could lose some counts.
E.g.
DM[100] = READMODBUS 13, 1, 1001 ' DM[100] is temporary location
Assuming the last good count was stored in DM[150]
IF (DM[150] - DM[100] > xxx) ' differences too large to be valid
..... ' do something about the new value - discard or store
ELSE
DM[150] = DM[100] ' seems like good counter value, store it.
ENDIF