Suppose when a train is at rest, it has a length of $L$. Let the position of the back of the train at any time be $A$, and let the position of the front of the train at any time be $B$.

Now assume a stationary observer on the Earth, O, observes point $A$ to be accelerating at a constant rate, $k$. Now as the train accelerates, O will observe the train to continually shrink, thanks to length contraction. Now since $A$ is measured to accelerate at a constant rate, the position of $B$ will depend on A's acceleration, and the rate of shrinkage.

So the question is, calculate the acceleration of point $B$, as measured by O, given the acceleration of point $A$, and the length of the train, $L$.

Now assume [...] point $A$ to be accelerating at a constant rate, $k$.

The prescription of "constant acceleration" is conveniently modelled as "constant proper acceleration" corresponding to hyperbolic motion against participants (such as "O") who were initially at rest wrt. $B$ and $A$ and each other (and who remain at rest to each other, as a inertial frame, allowing them to measure, among each other, the relevant distances and durations):

where the relation between the duration $t$ of members of the inertial frame (incl. participant "O"), from starting $A$ until the passage of $A$ at some particular member of the inertial frame, and the correponding duration $\tau_A$ of $A$, from being sent off until passing the particular member of the inertial frame as

[...] calculate the acceleration of point $B$, as measured by O, given the acceleration of point $A$, and the length of the train, $L$.

The prescription of the length of the train being and remaining "given" is sensibly modelled as the ping duration remaining constant; at least for pings of $A$ to $B$ and echoed back to $A$, (if not the other way around as well); i.e.

However, this solution doesn't hold for arbitrarily small/early $t_{O\text{refl}}$, but only for its values corresponding to $\tau_{A\text{sign}} \ge 0$, i.e. for ping signals which $A$ had stated at or after having started to accelerate. This applies for

Determining even earlier motion of $B$ (corresponding to pings stated by $A$ before starting to accelerate and with echoes received by $A$ after the start) may be more complicated ... but at least numerically possible (and sensible).
But it doesn't appear in turn that the ping duration of $B$ (from stating the signal to observing the echo from $A$) remains constant and equal to $T$.

Now as the train accelerates, O will observe the train to continually shrink, thanks to length contraction.

Well ...
Using the above equations of hyperbolic motion, of $A$ corresponding to the setup prescription, and of $B$ obtained accordingly as solution for containt ping duration $T_{ABA} := T$, it is possible to express the distance between any pair of members of the inertial frame (with O) whose indications of having been passed by $A$ and by $B$, respectively, were simultaneous: