The two Southeast Asian countries signed a cease-fire agreement on Monday after days of fighting that killed at least 38 people.