Odds are the dip tube that directs the incoming water to the bottom of the tank has broken off near the top. Without the dip tube there less mixing, and the water becomes stratified with the hottest water at the top (which is well above the heating element's thermostatic sensor.) That stratification makes the initial slug of water coming off the top of the tank pretty hot. But since the cold water is being injected at the top of the tank it's short-circuiting most of the water in the tank, making the exiting water temp drop fairly rapidly.
It's sometimes worth replacing the dip tube if it comes out cleanly. But in your in your case it's probably only as a DIY: A 12 year old unit it could be on it's last legs anyway, better to pay the pro to install a new unit than the travel time & labor just to swap out dip tube to get another coupla years out of it.