iPhone 4 restart when the lock button is broken
Plugging a phone into a computer or power source via the usb cable will power it on, even if it is off – your phone is in need of repair or replacement.

I've seen the apple logo appearing for a few seconds and then phone dying several times with dead phones. I've fixed countless phones, but I don't have a concrete answer for this problem other than it being related to the motherboard in your phone and the solution is a replacement (replacement part more than value of the phone)