They do indeed have the same root. In fact, a prăji is the root of prăjitură.
It seems that a prăji means using fire (usually in fat) upon a food item to make it edible or to process it. So besides frying, it also has this deeper meaning which at some time in the past made it a good reason to label cupcakes as prăjturi. Meanwhile, with the development of modern food it seems to have lost its broader meaning.
A little bit late, but I think I can answer this :) It seems to me, that this is one of many words of Slavic origin. Romanian sound j is pretty close to Czech ž or Polish ż. There is a word "pražit" (verb) or "pražený" (adjective) in Czech which means to roast/roasted (in the meaning of e.g. nuts, not meat). The same is in Polish (prażyć, prażony). In Slovak on the other hand the same word means "to fry".