Let's try posting this again with links. The links do get outdated after a while so message me if something doesn't work for you. A few other people on this forum have done this and I all seem to have had the same result as me with a correctly shifting transmission.
.....
You will need the ECU reworked either way. The hard parts will get destroyed again if you do not fix the ECU....
Here is the original post, with updates due to link changes. Only try this if you have a fair amount of competency when it comes to auto repair. I can only speak for myself when I explain what fixed my transmission. It is up to you to determine which of your parts need to be replaced. Might be the same, might be completely different. I hold no responsibility if you make it worse. I just wanted to spread the knowledge of what I did to hopefully help someone else in the same position.
I had the same issue on my moms car. The ECU was shifting wrong for too long and eventually messed up the transmission to where she did not have 3rd, 4th or reverse. I kept getting told I was going to have to pay $4000-$5000 to have the transmission rebuilt by tranny shops. With a little research, some luck and some faith I went upon the following fix. Keep in mind, I have never worked on a transmission and I cannot promise you yours will be broken the same way, but if it helps you then I thought I would pass on my experience.
First, make sure you get a reworked ECU otherwise it doesn't matter if the transmission itself is working as it should.
Drop the transmission pan to get all the fluid and metal shavings out.
Jack up the front drivers side of the car.
Remove the front drivers wheel.
At this point you should be able to see the back of the transmission
There is a rear cover on the transmission that you can remove without dropping the transmission at all.
See this video on YouTube for a walk-through. Even though he has the tranny out, you can do with part with it still in. Start around 3 minutes in
Once you have the cover removed, you will see the Direct Drum
See below links for order of parts along with part numbers to help you along
Whatever It Takes Transmission Parts
http://natpronet.com/trans/U140.pdf
Remove the inner fluid tube as shown in the youtube video
Now you should be able to pull on the Direct Drum (555 in diagram) and it should slide out. In my case, the clutch pack inside this drum was completely shredded and the rear Sun Gear (575 in diagram) came out together which is fine.
Since the clutch pack that goes between the Direct Drum and the Sun Gear was so far gone, both the Direct Drum and Sun Gear itself where banged up and needed to be replaced along with the clutch pack. Looking further into the transmission, it didn't look like anything else was damaged. The next clutch pack seemed fine and nothing looked torn up.
I was lucky and able to find a used Direct Drum for the U241E transmission on eBay that had the clutch pack (diagram 878 through 126) and piston (diagram 565) already inside it and ready to go. Otherwise you have to buy all the components separately and put together which isn't too difficult but finding all together was definitely a plus.
Direct Drum
U140 Direct Drum [U27555] - $99.99 | Cobra Transmission
Sun Gear
U140F, U241E Rear Planet Sun Gear Hub [A27614A] - $80.99 | Cobra Transmission
Both together are less than $200. Just make sure the Direct Drum comes with the clutch already in it. It looks like it is in this link.
Try to get all the metal shavings out if there are any you can see in transmission. Most should be on the magnets in the pan, but just get whatever you can out from anywhere you see them.
Make sure all bearings and washers are transferred from old gears or replaced. There was one inset on the Sun gear that doesn't look like it comes off, but it does.
To install the new Sun Gear I had to remove the next clutch pack from the transmission since it was easier than trying to line up all the gears as it twists into place. Removing the clutch pack is easy, just take the clip off like in the video and pull all the pieces out noting what orientation they are and in what order they go on. Good time to inspect that clutch pack. All my clutches still had writing on them, so they all seemed good to go. Once the clutch pack was out I was able to put the Sun gear in all the way. Now put the clutch pack back in the same order it was in until you get it all clipped back together.
Once you have that in, slide the Direct Drum back in lining up the teeth on the clutch inside it with the Sun gear. I'm skipping the step of putting together the clutch pack and piston inside the Direct Drum since I did not have to do it.
Once you have the Direct Drum on and pushed all the way in, you just have to replace the fluid tube and put the rear cover back on. I used a little transmission silicone to prevent leaks.
Put the clean pan back on and fill with fluid.
Drive it and see if the problem persists. Mine was fixed and shifted perfectly after not having 3rd, 4th or reverse at all.
It's possible only the clutch pack is toast and the hard parts are still good on yours, but my mom had driven it for a good while while messed up so I felt I need to replace them since it looked like they had been grinding together.
I really hope this helps. Like I said, I have never done anything with a transmission, but do consider myself to be on the more adept side of being a shade tree mechanic. I wanted to find a way to not have to spend $4k or drop the transmission and somehow was able.
I cannot guarantee this will fix your transmission. It is up to you if you are competent enough to take it apart and inspect to see what parts need to be replaced. You transmission may be messed up more or less than mine. This is just what I was able to do on mine. My mom has put a few thousand miles on the transmission since then and it is still working great.
This may be the correct two parts you need, but it doesn't look like it has the clutch on the direct drum. Hard to tell from pic.
https://www.ebay.com/itm/U140E-TOYO...2?hash=item4b37bdf986:g:d5EAAOSwBp9aehlC:sc:USPSPriority!78759!US!-1:rk:21:pf:0
I think this is the correct direct drum and you can see the clutches in it.
https://www.ebay.com/itm/1999-UP-TO...CH/233004431226?epid=658220767&hash=item364025777a:g:9LgAAOSwPv9bUkIZ:rk:3:pf:0
Here are other links that I used to gain familiarity.
http://shop.ukrtrans.biz/wp-content/uploads/catalogs/U241E.pdf
http://shop.ukrtrans.biz/wp-content/uploads/catalogs/U140E.pdf
http://akpp19.ru/files/toyota/U-140E,U241E.pdf
U140/U240/U241/U250 Hub Gear/Rear Sun Gear (167575A) | G-COR Automotive