Some of my auto rack end doors kept popping open. I found out one must secure these type doors carefully in order for them to remain closed while running the layout. In one instance, I had to use a very small piece of tape. Which I placed inside the door and then closed the other upon the tape. This works great and since I don't plan on placing any automobiles in that car, it is okay by me.
As for box car doors. That can be a most confounding problem. My solution. Put a Hobo figure in that box car and let him worry about that door for awhile. LOL
Seriously, I would follow the suggestions made by other members as they have likely dealt with this issue for a long time. Thus they have good ideas on how to deal with this.
Pete