There's a dip tube in the WH that directs the incoming cold water towards the bottom of the tank (hot comes off the top). On some models, there was a problem with that dip tube breaking up and inserting the cold near the top, reducing the amount of hot water you can obtain. This tube isn't expensive, and can be replaced, if it is non-existant any more. Most electric WH only activate one heating element at a time. The upper one extends the outlet temp when drawing water, switching to the lower one to reheat the entire tank when the top one gets warm enough (a few can use both at the same time). The thermostat or heating element of one or the other could be bad.
If you have an older showerhead, it could dump 4-5 gallons per minute, and 10-minutes of use could exhaust that tank. All newer ones are required to use 2.5 gpm or less. You could check the flow with a bucket and a watch.