(Firstly, apologies for the long post and if my language is condescending - not sure how familiar you guys are with the inner bits of laptops!!)
I’ve seen this problem as well but on a SZ4 Vaio - the battery would discharge faster than it could charge up and so would only charge when the laptop was switched off (even Vista’s sleep mode would lose charge, but hibernate was alright). I took it into a Sony shop and tested the battery in their machine (fine) but the problem occurred when I plugged my machine into their power supply. Sent it back into Sony (after some phone negaotiation - it was the last week before warranty ran out!) and they fixed it without really specifying what they did, but I think the motherboard was replaced as my device manager now believes I have the Core 2 Duo from the SZ7!!
Unfortunately I can’t think of any way to fix it other than buying a new motherboard or power supply unit, BUT… My TR has a huge split in the LCD membrane so I am swapping the motherboard out into a “broken” TR I got off ebay on the cheap (hopefully the screen is okay!), but having dismantled one machine, the power unit is the yellow thing with the pink and black wire that lead to a plug on the underside of the board - first thing would be to make sure that the plug is properly seated into the receiver on the board I guess. If that doesn’t work then the problem either with unit itself which isn’t that cheap nor easy to find (an HP one cost me £80 just for that small bit the adapter plugs into - a little difference between manufacturers is that the receiver sits directly on the motherboard so whereas I’d plugged mine in too far and knocked it clean off the board, with the wires in the Vaio that would be physically impossible to do); or with the board itself. That’s about as much as I know I’m afraid… good luck solving the problems!