I must say I make it a rule when I sit in an aircraft with any other qualified pilot to agree in advance who is PIC on that flight - even if the other pilot is an instructor. A lot depends on whether he is hours building or not - most of the instructors I come across are not, so they usually let me be PIC on any checks required by club rather than legal rules.
I absolutely agree that when the engine quits is no time to be arguing about who is in command. Mind you, with an experienced instructor in the RHS I think that would be my cue to say 'you have control...'
Tim