I've heard of this one and someone else having the same issue; the minute he's a companion he's unkillable/essential, and joining the brotherhood doesn't change that. It's a pretty serious bug.
If you are on a PC you could perhaps use the console to kill him/mark him as non essential.
If you are on a console you may be screwed
Are you on the PC? If so http://fallout.wikia.com/wiki/Fallout_4_console_commands to set him to killable -
Already posted a solution if you were on the PC...sorry for the tease :/
Your best bet now is to revert to an earlier save, and dismiss Deacon well before you take the kill Railroad mission.
I'm sorry man, but I'm not sure I am aware of one; until they patch it, Deacon is unkillable, and yet your main quest is requiring that you kill him.
The only solution I can suggest is to ignore the main storyline, go off and do something else, and hope that they fix it in the next patch.
No just biff him before taking that one quest.
So you took that one quest to kill the Railroad a long time ago and did a ton of things inbetween?
Yes good, then revert to an earlier save JUST BEFORE YOU TAKE THAT QUEST, dismiss Deacon first, then take the quest.
It's your best shot anyway. Maybe having Deacon with you at the exact moment you took the quest, and having the game reassign his faction is how you got bugged out...maybe game screwed his faction up for you.