In the early 1920s, Endel-Ragis attended military courses at Warsaw's Wyższa Szkoła Wojenna: on October 1, 1924, he was named officer of Polish General Staff, serving under Colonel Franciszek Wlad.
Endel-Ragis was then named commandant of the 22nd Mountain Infantry Division (Przemyśl), replacing General Mieczysław Boruta-Spiechowicz, who was moved to Bielsko Operational Group of Kraków Army.
In the night of September 2/3, 22nd Mountain Infantry Division unloaded from trains near Olkusz, and took its defensive positions, awaiting the units of Operational Group Slask (General Jan Jagmin-Sadowski).
In the night of September 9/10, 1939, Colonel Ragis, convinced that 22nd Mountain Infantry Division was completely destroyed, tried to commit suicide and shot himself in the head.
He survived due to efforts of military doctors, both Polish and German, and settled in the area of Kielce, joining the Home Army.