Does Time Machine backup iCloud Drive files that are not stored locally?
No, these files are not backed up by Time Machine.

iCloud has its own deleted file recovery, available from iCloud.com Settings → Restore Files, but this isn't a substitute for backups since modified files are not stored, only those deleted completely.