@Sandeep6
Using below in java also gives "edit" for value of wcmMode when loaded the page in design mode.
WCMMode wcmMode = WCMMode.fromRequest(slingRequest);
Also needed to refresh the page for the model to be invoked.
Something that worked was trying similar to below
slingRequest.getCookie("cq-editor-layer.page").getValue()