Two militants were killed by security forces while another surrendered after an encounter broke out in the Kulgam district of Jammu and Kashmir on Wednesday, officials said.