Answers

What you wrote in Japanese 囚人のガールフレンド（の）名前はマリアmeans: The prisoner's girlfriend's name is Maria. If you want to say "the name of the girlfriend's prisoner is Maria," you will have to say ガールフレンドの囚人の名前はマリア