The creation of these two colonies advanced the idea of democracy in the American colonies because these two colonies were based to some extent on ideas of political and personal freedom.
Rhode Island was founded by dissenters who were forced to leave the Massachusetts Bay Colony. These people, like Roger Williams, were forced out because they believed the "wrong" things. This led them to create a new colony that would allow religious freedom.
Similarly, Pennsylvania was set up by Quakers. This was a sect that was widely persecuted for its beliefs. Pennsylvania's laws allowed mandated complete tolerance of all religions.
Part of democracy is that governments must protect personal freedoms such as the freedom of religion. The establishment of these colonies was a step in that direction.