First tap the starter with a tool, like a hammer handle or similar solid object you may get access with. This may get it to release.
Attempt reconnecting. No? try again. Be sure the ignition key is turned off. Its also possible the key was removed but the tumbler was not turned back. These keys wear easy. 10 years now.
If still happens, you may have a mechanically jammed starter drive as well and have to remove and repair/replace the starter.
One unforseen variable is all the wire harness trouble toyota has been experiencing. If your starter bench tests good, runs and actuates and returns correctly. But repeats the problem when reinstalled, there could be an ignition switch and or wire harness concern.
It would be worth searching for a service bulletin to see if they have a preplanned update for this. You may take your vehicle info to an automotive database and check both recalls and tsb's. A database like that can also provide diagnostic test steps to remedy the need for guidance. It can also provide a pinout for an ignition switch. Public library is free to look 10c to print. Mitchell, at the library. not from home.
I think the battery was run dead by the problem. then when you brought fresh voltage to the circuit, it reengaged the battery drain trying to operate. This make can also suffer from wear in the ignition key tumbler as well. I have seen them stick or be ground up inside because of the soft non ferrous metals that comprise the internal workings. Some can be jumbled with tools to get in position to replace and others may take a drill to get out.
After self search of what you are facing. AAA tow to toyota may be the simplest, most correct, reliable, cost effective, replacement plan.
OBD2 Scanner for sale www.obd2works.com
Starter relay is bad.
Name it "Christine" and make movies with it.
I got a new battery and when I try to connect it, the motor immediately cranks (w/o the key in!). Any ideas what might cause this or how to prevent it? The old battery was dead and wouldn't hold a charge even when disconnected...is it possible the car went loco and drained it while it was turned off, damaging the old battery?