which attached usb device is which?
Before you find yourself in the same situation again, you need to first ascertain and mark each disk with its serial number where you can easily see it, or at least know where it is, if it's already on the outside of the case.
You can run the following command in Terminal with one disk at a time mounted:
system_profiler SPUSBDataType

Review the info and mark the case of the target disk. Then do the same for the second disk.
Then when you find yourself in this situation again, you can use Terminal to determine which disk is being written to.
First run the mount command.
When mounting two disks whose name are the same, using the mount command in Terminal, the second one mounted will show as e.g. /dev/disk4s2 on /Volumes/Name 1 while the first one mounted will show as e.g. /dev/disk3s2 on /Volumes/Name, e.g.:
/dev/disk3s2 on /Volumes/Name (hfs, local, nodev, nosuid, journaled, noowners)
/dev/disk4s2 on /Volumes/Name 1 (hfs, local, nodev, nosuid, journaled, noowners)

Now using sudo fs_usage -w -f diskio you'll see lots of messages, e.g.:
11:31:08.015616    WrData[ANT1]    D=0x0345b918  B=0x80000  /dev/disk4s2  /System/Volumes/Data/Volumes/Name 1/path/to/file

Seeing that it's /dev/disk4s2 being written to, then in this example case, you'd run diskutil eject disk3 to eject the disk of the same name that's not being written to, under the use case you described in your OP.
You would then run  system_profiler SPUSBDataType | grep -E '.*Serial Number:|.*BSD Name:' in Terminal, looking just at the information where there is a BSD Name: immediately following a Serial Number: to see which disk is, e.g disk3 by its serial number in this example.
Look at the serial number on the case of each disk and unplug the one that's not being written to base on the output of the commands run in Terminal.