The gemara says that we bury non-jews as well for darkei shalom. But rashi points out that we don't bury gentiles in jewish cemeteries. The Ran explains that the source for this din is that we don't bury a rasha next to a tzadik. Based on this, would it be permitted to bury a Jew who is a rasha in a non-jewish cemetery? R' Moshe (Igros Moshe Y.D. 3:146) elaborates about this issue. He assumes that the issur of burying a tzadik next to a rasha will only last for a limited amount of time. The gemara (Sanhedrin 46a) allows one to bury a rasha who was killed by beis din, in the kever of his fathers after their is "ichul basar" i.e. he begins to decompose, since that will serve as an atonement and he will achieve the status of a tzadik. R' Moshe is not convinced that reshaim who die a natural death would achieve atonement so quickly, but assumes that after 12 months, even they will achieve the status of a tzadik. Therefore, after 12 months has passed, the rasha can be buried next to a tzadik. Furthermore, based on the fact that the halacha fails to mention that after the 12 months pass we are not required to seperate the rasha from the tzadik who were buried together, implies that the entire halacha is only l'chatchila. Meaning, l'chatchila a rasha and tzadik can't be buried together, but if it is done we do not have to move them, even within the 12 months.
Regarding a gentile however, R' Moshe explains that the Ran doesn't mean to suggest that a jew is assumed to be a tzadik and a gentile a rasha, because based on that rationale it should be permitted to bury a jew next to a goy who kept the 7 mitzvos (and we don't find this distinction). Rather, the Ran meant to say that the kedushas yisroel of the jew will always give the him an advantage, just as the tzadik has the advantage over the rasha. Being that it is not based on merit, rather on kedushas yisroel, the time passing doesn't matter and even after 12 months they cannot be buried together. Therefore, it is plausible that just as we are machmir even after 12 months, we are also machmir b'dieved, and even after they are buried together they have to be separated.
R' Moshe does provide a leniency that so long as there is a 10 tefach fence around the grave of the jew, he is not considered to be in a non-jewish cemetery.