Both options still have many open questions on accessibility, but I would go with option #2.
Because your question seems to focus only on the visual aspects of the UI, I’m not going into details about exposed roles and states.
Accessibility role and visual presentation are an affordance, they communicate expected behaviour: These buttons do not take any actions, they set a state, an answer. This is the behaviour of radio buttons.
Buttons glued to each other (and not in a toolbar) communicate that behaviour better than buttons apart. That behaviour is
- The button state is changed by means of arrow keys
- Only one of the buttons can be pressed/checked at a time and keeps that state
See Bootstrap’s Radio Button Group
Use of colour
Another aspect is that you use only colour to distinguish the button’s state in option #1, which fails accessibility criteria. The icon in #2 solves that issue, if it is shown only for the pressed or checked state.
From the WCAG, Use of Color
Color is not used as the only visual means of conveying information, indicating an action, prompting a response, or distinguishing a visual element.
Also, contrast of the leading question is way better in option #2.