You have to get together and decide what happened first. The rules do not provide for a simultaneous whistle in this particular case.
Whoever granted the TO on a loose ball was wrong to do so, of course, but that doesn't change the call if you go with the granted TO happening first. Call it an inadvertant whistle during a loose ball while A had team control, grant the TO, and then after the TO give team A a spot throw-in at the closest spot to where the ball was when the whistle blew.
|