Braskem SA and its creditors have reached an agreement on the main terms of an out-of-court restructuring deal, a key step in the Brazilian petrochemical giant’s efforts to rework its debt after months of tense negotiations.