It's the commanders decision in my outfit, however every deviation from a clearance due to system malfunctions is initially a mayday, since pretty much all EOSIDS deviate from the cleared SID it is a mandatory mayday to start with. Same during cruise, since maintaining altitude is impossible.
In my opinion, start with a mayday, you can always downgrade it to a PAN state once everything is secured.