This is actually a rather subtle point never fully appreciated by students the first time they learn relativity.
There is a difference between someone at A receiving the photons from event X, and event X actually occurring. In physics classes (as distinct from astronomy), we are almost always talking about the occurrence of the event, not its observation. The idea is you set up your canonical grid of rulers and clocks throughout space. Events happen. Later on, at your own convenience, you go and visit the clocks (or have them send you data) and assemble the whole picture. This God's-eye perspective is what we usually have, where we witness "simultaneous" events simultaneously only because we are post-processing the data.
To emphasize: events are single points in spacetime, and they do not change place or time. Event X may have occurred at B's location - fine - but then don't confuse X with Y = (the observation of X by A), which is another event entirely, occurring at a different place (A rather than B) at a different time (1 light-second later than X, in the frame of A/B).
So:
Yes they are in the same frame. Both will agree, in post-processing, that the simultaneous event happened at the same time. A will see the flash at A first, and ditto for B, but there won't be any confusion after the fact when they get together and discuss what their grids of clocks said.
See 1.
Carefully. If you ever take your physics "rocketships and grids of rulers" training and go into astronomy, you'll learn to appreciate the fact that we are looking out along our past light cone, rather than "horizontally" in a spacetime diagram. We don't have an infinite grid of clocks spread throughout the universe to query, but rather just our telescopes right here. You already know that the further away an event, the longer the elapsed time between it and its observation. But the key is to internalize that, and get used to adding and subtracting corrections to account for it.
The only safe way for beginners to answer questions in special relativity is to sit down with a large sheet of paper and work through the Lorentz tranformations:
$$\begin{align}
t' &= \gamma (t - \frac{vx}{c^2}) \\
x' &= \gamma (x - vt)
\end{align}$$
Let's be absolutely clear what the tranformations tell us. If we use a coordinate system $(t, x)$ to label spacetime points, and another observer moving at constant velocity $v$ relative to us uses another coordinate system $(t', x')$, the transformations convert our labels $(t, x)$ to the other observer's labels $(t' x')$.
So to answer your question we take the two spacetime points labelling the ends of the train and apply the transformations. This tells us where those two points are in the moving observer's coordinates.
In our frame at $t = 0$ the middle of train is at $(0, 0)$, so the front of the train is at $(0, d/2)$ and the rear of the train is at $(0, -d/2)$ (I've called the length of the train $d$ to avoid confusion with the $x$ coordinate):
To find the potition of the front of the train in the primed frame we just feed $t = 0$ and $x = d/2$ into the Lorentz transformations:
$$\begin{align}
t' &= \gamma (- \frac{vd}{2c^2}) \\
x' &= \gamma \frac{d}{2}
\end{align}$$
So in the moving frame the lightning strike at front of the train is at $(-\gamma\tfrac{vd}{2c^2}, \gamma\tfrac{d}{2})$. I won't go through the details, but same calculation puts the lightning strike at the end of the train is at $(\gamma\tfrac{vd}{2c^2}, -\gamma\tfrac{d}{2})$.
So the answer is that the observer on the train sees the lightning strike the front of the train at $t' = -\gamma\tfrac{vd}{2c^2}$ and the rear of the train at $t' = \gamma\tfrac{vd}{2c^2}$. The time between the lightning strikes is $\gamma\tfrac{vd}{c^2}$.
Quick footnote
Rereading my answer it's just occurred to me that I've called the length of the train $d$ in the rest frame of the track. The length of the train for the observers on it will be greater - you can use the Lorentz transformations to calculate this too.
Length of the train
Re Graviton's comment, the easiest way to calculate the length of the train in the train's rest frame is to work backwards. Let's call the length of the train in its rest frame $\ell$, and we'll choose our zero time so that the rear of the train is at $(0, 0)$ and the front is at $(0, \ell)$. To transform from the train frame to the track frame we just use the Lorentz transformations as before, but in this case the velocity is $-v$ because if the train is moving at $v$ wrt to the track then the track is moving at $-v$ wrt the train.
When we do the transformation $(0, 0)$ just goes to $(0, 0)$ so we just need to work out where $(0, \ell)$ is in the track frame. Plugging in $t = 0$ and $x = \ell$ we find the point in the track frame is:
$$\begin{align}
t &= \gamma (t' - \frac{(-v)x'}{c^2}) = \gamma\frac{v\ell}{c^2} \\
x &= \gamma (x' - (-v)t) = \gamma\ell
\end{align}$$
So in the track frame the front of the train is at $(\gamma\tfrac{v\ell}{c^2}, \gamma\ell)$. But we don't want to know where the front of the train is at time $t = \gamma\tfrac{v\ell}{c^2}$, we want to know where is was at $t = 0$. So we take our value for $x$ at time $\gamma\frac{v\ell}{c^2}$ and subtract off the distance moved in time $\gamma\frac{v\ell}{c^2}$, which is just the time multiplied by the velocity. This gives us the value for $x_0$:
$$ x_0 = \gamma\ell - \gamma\frac{v\ell}{c^2} v $$
The rest is just algebra. We write the expression out in full to get:
$$\begin{align}
x_0 &= \ell \left( \frac{1 - \frac{v^2}{c^2}} {\sqrt{1 - \frac{v^2}{c^2}}} \right) \\
&= \ell \sqrt{1 - \frac{v^2}{c^2}} \\
&= \frac{\ell}{\gamma}
\end{align}$$
And since the rear of the train is at $x = 0$ at time zero and the front of the train is at $x = x_0$ at time zero the length of the train is just $x_0$ so:
$$ d = \frac{\ell}{\gamma} $$
At all speeds $> 0$ the value of $\gamma > 1$, so the length of the train as observed from the track is less than the length of the train in its rest frame i.e. the train is shortened. This is the Lorentz contraction.
Best Answer
Your logic is correct but for one misunderstanding right at the beginning. The observer is smart enough to know that just because the photons are received simultaneously doesn't mean they were emitted at the same time. The emitting of a photon and the receiving at a different time and different place are two distinct events, as explored further in this post, among others.
Basically, you need to find a position and a velocity such that the observer infers that the photons were emitted simultaneously. The observer makes this inference by saying the travel time for a photon is the distance between his current position and the source, as measured in his moving frame, divided by $c$.
In fact, you don't even need to solve for the position to get the velocity, but I'll let you crank through the appropriate Lorentz transformations.