Most cars now have a solenoid that keeps you from shifting out of park unless your foot is on the brake. This needs electricity to work. My saturn, floor shift automatic, would let you move the shifter to neutral from park with the key in "Accessory" without electricity. Key off, there was an anti theft cable, all mechanical. Key on, there was a solenoid blocking the path, and a relay or two in the brake light circuit to energize/de-energize that solenoid.
The Audi 5000 "sudden acelleration" controversy of the mid 1980s created the need for these interlocks.
We don't know if this car is a floor or column shift auto, or even what it is. Column shift autos tend to use a mechanical key switch/ shifter starter kill interlock. This is a different interlock than the "let me out of park" interlock. It also has to work, obviously, but you can't turn the key to start unless it's in P or N.
To OP, you have a dead dead dead battery in the receiving car. Best bet is to throw a cheapie $20 walmart 6 amp charger on it overnight or at least a couple hours so you can get the transmission to unlock.
Tow truck drivers know how to quickly pop most shift linkages to bypass all this drama, BTW.