When you fail a story mission, you don't lose any items or characters. The game will give you a hint about which character you could upgrade to better tackle the enemies in that particular mission. You can replay the mission as many times as needed before you finally beat it.