Are Emiya Shirou and Kotomine Shirou the same person?
He looks like Archer/Emiya.
If so, how did he become Kotomine and get a job as Holy Grail War Mediator?
no, Emiya Shirou and Kotomine Shirou are 2 different people. infact apart from their appearance resembling one another in a way the only thing they both have in common is that they are both people who end up become 2 different Servants for Holy Grail Wars and at one stage were also Masters
Emiya Shirou ends up one day becoming Heroic Spirit EMIYA and summoned as Archer in both Fate/Stay Night's Fifth Holy Grail War and Fate/Extra's Moon Cell Holy Grail War (though in the latter his name has become lost in history)
Kotomine Shirou is one of the Masters of the Red Faction in Fate/Apocrypha, Master of Assassin and Leader of the faction. however his true identity is Amakusa Shirou Tokisada
Shirou's True Name is Amakusa Shirou Tokisada (天草 四郎 時貞, Amakusa Shirō Tokisada), the teenage leader of the Shimabara Rebellion. Born in the Edo period, he was a boy of miracles who could nearly be called a saint. However, how exactly he was discovered; a good half of his lifetime is wrapped in mystery.
He was originally summoned as the Ruler Servant during the Third Holy Grail War by the Einzbern Family instead of Angra Mainyu as Avenger however the war never ended properly due to the Nazi's stealing the Greater Grail thanks to Darnic Prestone Yggdmillennia who then ended up stealing it from them.
in Fate/Aprocypha's timeline after the third war he spent time with Risei Kotomine and was "raised" with Kire Kotomine. he was later sent by the Church when the Mage's Association wanted a member of the Church to side with them in reclaiming the Greater Holy Grail from Yggdmillennia.
Differing from the timeline of Fate/stay night's Third Holy Grail War where the Einzbern family summoned the Avenger-class Angra Mainyu, they abuse one of the systems installed in the Greater Grail and brought forth Shirou as a Ruler-class Servant who was meant to be an impartial authority whom regulated the progress of the War. The Einzberns wished to call forth a proper Heroic Spirit befitting of the Ruler class rather than some nameless Eastern hero. However the act of summoning a Ruler was already a severe interference in the normal operating format of the Holy Grail War so he was a compromise with the advantage of his Command Spells
As Risei Kotomine rescued the Master of the Tohsaka, Shirou helped him with his rescue work. As Darnic successfully stolen the Greater Grail, the survivors were Shirou and Risei.
Risei prepared a family register, registering him as his son "Shirou Kotomine" (言峰 天草, Kotomine Shirō). He had joined with the Church thanks to Risei's connections. He entered the Assembly of the Eighth Sacrament as Kotomine Shirou, but naturally Risei couldn't acknowledge him as his son there and approached him honestly as a friend. Around the time when Risei's son was born, Shirou had deliberately diminished his contact with Risei. Shirou remained distant from Risei's own son. Shirou consciously avoids Kirei Kotomine because Shirou noticed the "distortion" within his stepbrother.
As the Mage's Association decided to seek one Master from the Church in order to have their involvement prove the legitimacy of their cause. Having already hypothesized the possibility of a Great Holy Grail War—a situation with seven Servants versus seven Servants occurring instead of a normal Holy Grail War. In such an abnormal situation with seven Servants versus seven Servants and where even the previous Ruler had summoned his own Servant, the Greater Grail automatically summoned the Ruler for this war, Jeanne d'Arc, but Shirou had included even that into his calculations as an event within his expectations. Shirou promptly joined the Red faction as the dual mediator and Master sent by the Holy Church.
so as you can see the Kotomine part of his name was used to cover up his identity while the Shirou part actually comes from his real name
Since Fate is about the possibility and other timelines in the same Universe, and it says that Amakusa Shirou and how he was discovered are wrapped in mystery.
Could it be said that Shirou could be set as a deterrent force sent back in time with wiped-off memory to save people, or maybe he wished to be a hero of justice and the grail made him be reverse reincarnated into a boy who had the same wish. Then he was killed, used as a Servant and repeated the process.
I feel that given what happens in Fate, nothing seems impossible.