I would like to prevent certain content from being accessed if a user has switched to a mobile device.
Can this be determined using Liquid, as opposed to using javascript to check for window.innerWidth or window.navigator.userAgent
I don't think it is possible in Liquid (unless there is an undocumented item for it in the request object).
They generally make use of CSS Media tags for formatting the content based on the window size.