I think there is a possibillity that the fuel pump relay is bad too. Fuel
pump are also another possibility.
I would think that if the battery were lame, it would not start then
seconds later totally die to the point of supplying no electricity.
Also, after startup, it is possible to take the battery out(Though not
suggested since it acts as a damper in the electrical system.) and the
car will still run on the alternator. I'd suspect a loose wire
somewhere, or a bad ignition switch like T.G. said. The fuel pump
relay may explain the random dying, but not the totally dead
electrical system.