If that debt is unpaid, if the candidate walks away.... A candidate ceases to be a candidate after the election. The EDA continues and so does the party. The EDA, the electoral district association, the riding association, would take on that debt and have reporting requirements to pay back the loan with interest, if it's to a financial institution. If for some reason the riding association ceases to exist, it would go on to the party, and all those responsibilities would be moved on to the party as well.
As for a riding association, most parties go through some type of nomination process, some type of agreement on the candidate, so there's some buy-in from the riding association. Further, the leader of the party would also sign the candidate's nomination papers. Therefore, there's agreement that the person is the candidate, there's a certain amount of trust in the person, and the person will be carrying the party's flag in the election. There's definitely a buy-in from all levels for that candidate.