Is the a derailleur system or an internal hub gear? In either case, it appears that a pawl in the ratchet mechanism may be sticking. If you have a freehub or freewheel, flush the mechanism with solvent to loosen things up, then relubricate. If you have an internal hub gear with an oil port, you can flush it out through the oil port. If it's an internal hub gear without an oil port it will need to be opened up and cleaned.