Safety guidelines when using MTB clipless pedals on a road bike
This answer is for SPD pedals, which are the most common MTB pedals. Other systems do not have multi release cleat, and some don't even have adjustable springs.

First: make sure you do not have multi-release cleats. They are designed to release when pulled up hard enough, and can be distinguished by letter "M" stamped to them. If the cleats are too worn to tell whether they have the marking, it's probably best to replace them anyway.

Second: Adjust the release spring tension so that the pedals are easy to unclip but not any looser. Too loose pedals may release unintentionally.

Third: If these do not help, it's probably time for new pedals.