How do I block an app from using mobile data even in foreground?
Use a Firewall. See Firewall Tag Wiki for helpful reading.
Net Guard is a well acclaimed app that does not need root access. It is an open source app developed by  Marcel and can be downloaded from F-Droid too. It is very effective and has excellent logging features too.