It depends entirely on
when the Nationalists are defeated. The only time it was really likely to happen was during the initial coup attempt or shortly thereafter; the longer the war progressed, the longer the Republican's odds of winning became.
In a short war scenario, or a scenario where the coup is crushed immediately without the Army of Africa reaching mainland Spain, the Socialist led Popular Front coalition government would probably survive in some form. Democracy in Spain however, at least in the form that it was for the 1936 general election, would not; the electoral system made single-party governments next to impossible and resulted in tail-wagging-dog coalitions dominated by the extremist parties, both in government and in the opposition. The Popular Front itself, after winning the 1936 general election with a razor thin margin, believed it had an electoral mandate for radical reform in a crash-or-crash-through attitude; had they survived the attempted coup and civil war that belief would probably have hardened. The large scale killings of political opponents by both sides at the start of the civil war make it clear that even with a Nationalist defeat, the aftermath would have been a bloody affair.
A takeover by the Communists would have been unlikely; the Spanish Communist party (PCE:
Partido Comunista de Espana) was Comintern aligned and took directions from Moscow, and Stalin did not want a blatant Communist takeover because it would alienate the British and French at a time when he was trying to organise a united front with them against the growing threat from Germany. The PCE would have remained in the Popular Front and allowed the Socialist parties to have the leading public positions, while they took key administrative roles; dominating the government without being seen to.
The relationship with the Basques and Catalan parties would have been difficult; the Basques were ideologically the opposite of the Popular Front; they were to the right politically and Catholic, whereas the PF was dominated by secular socialist parties. Their only common ground had been an opposition to the Nationalists and the Falange (the Fascist party); remove that common ground and, now that all parties had resorted to arms, violent conflict is bound to result.