My battery is flat is perfectly fine in British English, but from the comments, it might not be understood in American English, depending on the context.
My phone is flat is sometimes used according to a quick Google search, but it isn't particularly common in British English and may be misunderstood. It might be more common to say my phone is dead.
This use of flat for an electric battery was first used in 1951 according to the OED (sense 9c). The others related senses are: 9a) wanting in energy and spirit (1604); 9b) depressed, dull or inactive trade (1831); and 9d) a drink that has lost its flavour or sharpness (1617).
I found three 1941 antedatings in Starters and Generators (Edward Molloy, Ernest Walter Knott). Page 85:
If the clutch is not slipping, the trouble may be insufficient volts reaching the motor, due to a flat battery or a bad connection or switch introducing resistance in the circuit, an electrical fault in the starter, or, very rarely, a mechanical fault in the starter.
Page 86:
A flat battery should be replaced, but the reason for the battery being discharged should be investigated.
Page 98:
Under this no-gap condition, the plunger will remain home on a very reduced voltage (which may occur with a flat battery) and will be less susceptible to vibration, and the contact pressure is a fixed and known amount, being the force of the spring (11), and does not vary with voltage.