There are recommendations. But they are not law unless the municipality enacts laws to follow the guidelines. There are also ways around the guidelines if the municipality want to allow it.
Generally the building must be 100' from the property line per the guidelines. And also include mitigation measures for noise and vibration. May also include crash walls designed into the building. Again it's up to the municipalities to enforce whatever they want.
This is the website. Looks like there is an ongoing study to 'modernize' the guidelines issued in 2013.
https://www.railcan.ca/safety/proximity-initiative/
2013 guidelines are here:
https://www.railcan.ca/wp-content/up...elopment_E.pdf