Just add both buttons and hide unnecessary with triggers. Two buttons is convenient to easy implement different behavior.
Add something like this to your template:
<ControlTemplate TargetType="{x:Type Window}">
...
<cc:ImageButton ImageSource=".../CloseWindow.png" x:Name="closeButton" Click="OnCloseClick" />
<cc:ImageButton ImageSource=".../MaximizeWindow.png" x:Name="maximizeButton" Visibility="Collapsed" Click="OnMaximizeClick" />
<cc:ImageButton ImageSource=".../RestoreWindow.png" x:Name="restoreButton" Visibility="Collapsed" Click="OnRestoreClick" />
<cc:ImageButton ImageSource=".../Help.png" x:Name="helpButton" Click="OnHelpClick" />
...
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="ResizeMode" Value="CanResizeWithGrip" />
<Condition Property="WindowState" Value="Normal" />
</MultiTrigger.Conditions>
<Setter TargetName="maximizeButton" Property="Visibility" Value="Visible" />
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Never mind cc:ImageButton - just replace it with Image or any. Also You may omit the first trigger condition if You do not need to style not resizable windows.
It is also possible to change ImageSource for a single Image. But two buttons are more flexible.
If it is needed i can post full source of my window style. It works fine.