Short platforms are a cause of lack of capacity. Lengthening can be easy, or very costly, depending on the precise situation. In the days of slam door trains, passengers were often told to travel in certain carriages if they were going to station with short platforms; for example, to sit in the front two coaches for Much Wittering. The guard would check to make sure that passengers for Much Wittering were in the right part of the train.
Whilst this sounds hazardous, in practice it worked well. People were expected to look out for themselves and check if there was a platform to step onto before opening the door of the train. Then came power-operated doors under the control of the train staff, and they became responsible for making sure that a door cannot be opened unless it was safe to step off. Some new trains now have a system of selective door operation (SDO), which should make it impossible to open the wrong doors. Unfortunately, this can be inflexible. The selection options on some types of stock are limited - for example, the open/close over-ride sometimes applies to entire four-car units.
SDO systems work to a database of stations, using GPS to ascertain where the train is. This is a quick-and-dirty fix. It is vulnerable to, amongst other things, failure of GPS navigation and can only be fitted easily to modern stock with a train management system.
How about a simpler system? Each door could be fitted with a detector, wired into the door operation circuit so as to prevent opening of that particular door unless there was a platform alongside. This might, for example, be achieved by fitting reflector strip (like car number.plate material) on the platform face, and a light and photocell at each doorway of the train. The advantage is that the train would not need to "know" where it was.
I once discussed this with an engineer who came up with three possible alternative solutions over a cup of coffee, so it is not difficult.