Yeah, but Frederick is already in the game, and technically (at least as I understand it), both Prussia and Austria were part of the Holy Roman Empire. The struggles between Frederick and Maria Theressa were over whether or not Austria could claim to control the portions of the HRE that Prussia held (or wanted to hold) juristiction over. So, Frederick was not a Holy Roman Emperor, but he could be said to have been an important leader within a faction of the Holy Roman Empire. (Technically, Hannibal was never in charge of Carthage either, nor was Ghandi in charge of India, but Civ doesn't really seem to care that much about such things.)
Franz Josef I is harder to argue in favor of, since as you say, the Holy Roman Empire had been officially dissolved two generations prior to his reign as emperor of Austria. The only case for his inclusion as a leader of the HRE is that he was in-line for the position, had the HRE continued to exist. Firaxis makes a similar move when they categorize Churchill as an English leader instead of creating a seperate British civ. The more practical argument is that the HRE is in the game, and it was ruled largely by the Austrian royal line. If you don't put Franz Josef I under the HRE banner, he has to go under an Austrian banner, and that creates the problem that most of the other possible leaders, units, etc for Austria were from the time before the HRE was dissolved, and thus belong to that faction as well. It's a case of either stretching the category or creating a redundancy. As I prefer to err on the first side, I'd rather just put him under the HRE, just as I'd put Nelson Mandella in the same civ as Shaka (probably not named Zulus though).
All of that to say, you're right, but I still think that putting them in the HRE is a viable option, the easiest option to streamline into the existing game, and a way to justify the existence of the Holy Roman Empire's presence.