... a Computer is treated in this case the same as a User ....
Whilst that is true to a certain degree, it doesn't mean what you think it means.
Within a modern windows computer everything runs as particular windows accounts. Background processes that keep the computer winning (the operating system for instance), might run as a windows or AD account that refers to the computer (and anything, that process does, is dome with the permissions of the computer (your group A)
When a user logs on, an environment is created running as the windows or AD account belonging to user, and anything that the user does (runs a program etc) runs with the permissions of the user account (your group .
If the user launches the application accessing your file, only the group B permissions will apply, as the USER launched the file.
Whilst there might be ways to frig the computer to open the file, this would not be easy to arrange, and likely not be something which is otherwise secure. So as welcoming as that idea sounds, discard it.
In short - basic Windows /AD permissions cannot do what you want,s owe need to explore other avenues.
For example, could the file be bought locally onto the PC? (and if so how frequently would it need to be updated?) or is live shared access necessary. If This sound feasible then something like a loopback group policy might help.