The location of Ruritania in the novel
In the novel Streslau, the capital of Ruritania, is on the railroad line between Dresden in the kingdom of Saxony in the German Empire and Prague in the kingdom of Bohemia in the Austrian Empire, which gives a good idea of the location of Ruritania..
My opinion is that Ruritania might be based on the kingdom of Saxony in the German Empire Saxony had a bit of social and political upheaval: the socialist parties gained majorities in the elections and it became know as the "red" kingdom.
Another theory is that Ruritania may have been largely Lusatia. Perhaps both upper and lower Lusatia or merely lower Lusatia, with a bit of Saxony attached, since the capital Streslau, on the railroad from Prague to Dresden, would probably have been west of Lusatia.
In 1635 the Holy Roman Emperor and king of Bohemia gave the Lusatias, crown lands of Bohemia, to the elector of Saxony in return for support in the Thirty years War, A generation or so later Emperor Leopold I reward Elector Augustus the Strong of Saxony for support by helping him get elected king of Poland. Perhaps in an alternate universe Leopold instead rewarded Augustus the Strong by making Ruritania/Lusatia a kingdom, and Augustus later gave the kingdom of Ruritania to one of his illegitimate sons instead of his legitimate son.
If the capital was fifty miles south of the northern border, it might have been fifty miles south of the northernmost border in Lusatia, and a lot less than fifty miles south of the border directly north of Streslau, which may have been in a sort of panhandle sticking out to the west and south of Lusatia.
I believe that the train ride from Zenda to Streslau took about 90 minutes from 800 AM to 930 AM. At an average speed of ten to fifty miles per hour the train would have traveled about 15 to 75 miles.
If Ruritania was supposed to be part of the German Empire but not part of the kingdom of Prussia, then it was probably an ally of Prussia in 1866 and became part of the North German Confederation and the German Empire but not part of the Kingdom of Prussia.
But if Ruritania was an independent nation and not part of the German Empire or Austrian Empire that would be harder to explain.
One reason that Ruritania might not have been annexed to Prussia and/or to the German Empire was the catholic religion of Ruritania. Bismark didn't want a Germany with a Catholic majority and so did not try to annex Bohemia or Austria - which would have required a lot more fighting in 1866.
Saxony became protestant in the 1500s. When Augustus the Strong converted to Catholicism to help gain the Polish throne he did not reconvert Saxony to Catholicism. Perhaps Prisoner of Zenda is in an alternate universe where Saxony never became Protestant or was reconverted to Catholicism by Augustus the Strong.
The Lusatias were ruled by the Habsburgs from 1526 to 1635 but they were unable to keep the Lusatias Catholic. Perhaps Prisoner of Zenda is an an alternate universe where the Habsburgs did keep Lusatia Catholic.
Bohemia itself was largely Protestant a century before Martin Luther, but after winning the Battle of White Mountain against the Bohemian rebels in 1620 the Habsburgs were able to convert Bohemia to Catholicism. Possibly Ruritania contains a strip of land in the mountains of northern Bohemia with a Catholic population. I don't know when or how that strip would have become part of a separate kingdom in an alternate universe - possibly during the Thirty Years War.
One reason why the tiny princepality of Lichtenstein was not made part of the German Empire in 1866-1871 was the fact it was surrounded by Switzerland and Austria. A longer and bloodier war would have had to be fought against Switzerland and/or Austria in 1866 to annex lands up to and including Lichtenstein.
So perhaps Ruritania was a small Catholic land largely surrounded by Catholic lands ruled by Austria in 1866. Bismark would not have wanted to annex those Austrian Catholic lands so he might not have annexed Ruritania in the middle of them. Thus we can suppose that the Habsburgs retained Lower (or northern) Lusatia and Silesia and most of Bohemia
in 1866 and kept those lands mostly Catholic so Ruritania was surrounded on three sides by Austria. Possibly Ruritania and Austria ended up as the only members of the German Confederation left.
Of course this movie opens with a map of Europe and the camera moves east and south toward the Balkans, implying that Ruritania was a Balkan nation.