That's explicitly not how our system works. If you have a claim to a right rooted in the Constitution, you do not need to convince the majority to see things your way. Your rights emanating from the Constitution (and further from the Constitution of your state) trump the majority.
You could have Supreme Courts without representative Democracy.
You could have direct democracy on issues (Brexit e.g.) within representative democracy.
Majority agrees with this form of government including Supreme Court and Constitutional Rights. If 99% of USA agreed to not follow constitution, would Supreme Courts be able to enforce their opinions? Majority agrees to give that power to Supreme Court and is upholding it everyday.
If you think we gave our constitution to ISIS today, they would function the same way, without buying into it?